Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Answer: How do I send e-mail from my Perl Program?

by silent11 (Vicar)
on Feb 08, 2002 at 16:42 UTC ( #144133=categorized answer: print w/replies, xml ) Need Help??

Q&A > mail and news > How do I send e-mail from my Perl Program? - Answer contributed by silent11

I use Mail::Sendmail, here is some code that use and reuse. Be usre to set your mail server in tho, here is a snipped of code that will send HTML email.
use Mail::Sendmail; %mail = ( from => '', to => '', subject => 'Test HTML mail', 'content-type' => 'text/html; charset="iso-8859-1"', ); $mail{body} = <<END_OF_BODY; <html> <head> <style> body {font-family: Verdana; size: 10px; color:black;} </style> </head> <body> Here is the contents of your email, use html as you wish ...... have f +un! </body> </html> END_OF_BODY sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";
  - Silent11

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-10-22 05:01 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.