[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

re: [MacPerl] sending email from a form



"Stephane Jose" <jose.stephane@uqam.ca> writes:
} Hello,
} 
} I'd like to adapt a unix cgi script that sends data parsed from a form to
} an email address.
} 
} I know how to format the data so it looks like a valid email, with the
} right headers and all, but the original perl script printed the data to a
} file piped to 'sendmail'
} 
}                 open(MAIL,"|/usr/lib/sendmail -t");
}                 print MAIL $my_data_here;
}                         [...]
} 
} How can I implement this with MacPerl and MacHTTP? I'd like to avoid using
} Applescript and Eudora.

The easiest thing would be to connect directly to your friendly
neighborhood SMTP server (that's all sendmail is) from your Perl
script, using something like Mark Probert's SMTPlib.pl, or if you're
feeling more adventurous and don't mind fixing a Unixcentric (mildly,
in this case) module from the CPAN archives, Net::SMTP.  (I've fixed
Net::SMTP, but haven't tested it yet.)  I don't know where to find Mark
Probert's package on the Web, but it was posted to this list, I
believe, and so you should be able to turn it up by going to Sandra
Silcot's site
<http://www.unimelb.edu.au/%7Essilcot/macperl-primer/home.html> and
using the searchable archive of this list there.

} 
} Any suggestions?
} Thanks in advance.
} 
} Stephane
} 
}                 ___S__t__e__p__h__a__n__e______J__o__s__e___
}                             jose.stephane@uqam.ca
}                     http://www.er.uqam.ca/nobel/m206474/
} 
} 
} 
---
--------
Paul J. Schinder
NASA Goddard Space Flight Center,
Code 693, Greenbelt, MD 20771 USA
schinder@pjstoaster.pg.md.us