[Chicago-talk] emailing from perl

Jay Strauss me at heyjay.com
Thu Aug 2 11:31:03 PDT 2007


I've never setup a emailer, I'll have to do that first

On 8/2/07, Mike Fragassi <frag at ripco.com> wrote:
>
> First, some pointers:
>
> The Perl Email Project Wiki:
>    http://emailproject.perl.org/wiki/Main_Page
> Ricardo Signes' talk on the P.E.P. at YAPC 2007:
>    http://www.slideshare.net/rjbs/how-i-learned-to-stop-worrying-and-love-email-the-2007-pep-talk/
>    (click the "Download" link)
>
> The slides have numerous examples for sending mail, about half-way in.
>
> Finally, can you send plain old email from your host's command line?
> I.e.:
>     mail -s "test" you at somewhere.com < file
>
> If that works, then if you continue to have problems with mailing
> via Perl, there's a very hacky solution.  Just replace this:
>
>    # Mail HTML document.
>    # Params: filename, subject, recipient
>    # Returns: none
>    sub MailDocument() {
>
> with this:
>
>    sub MailDocument {
>       my ($file, $subj, $to) = @_;
>       `mail -s $subj $to < $file`;
>
> Just add some parameter testing for validity & taintedness, and
> checking of the output/error from the mail command.
>
> -- Mike F.
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>


More information about the Chicago-talk mailing list