nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
orsub send_email_html { local($to, $from, $subject, $bodyHTML, $bodyTEXT) = @_; open (MAIL,"|$sendmailprog -t") || &return_error("500", "Sendm +ail error"); print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n"; print MAIL "MIME-Version: 1.0\n"; print MAIL "Content-Transfer-Encoding: quoted-printable\n"; print MAIL "Content-type: multipart/alternative; "; print MAIL " boundary = unique-boundary-1\n"; print MAIL "This is a MIME encoded message.\n"; print MAIL "\n"; print MAIL "--unique-boundary-1\n"; print MAIL "Content-type: text/plain; charset=US-ASCII\n"; print MAIL "\n"; print MAIL "$bodyTEXT\n"; print MAIL "\n"; print MAIL "--unique-boundary-1\n"; print MAIL "Content-type: text/html; charset=US-ASCII\n"; print MAIL "\n"; print MAIL "$bodyHTML\n"; close (MAIL); }
use Mail::Bulkmail; $bulk = Mail::Bulkmail->new( Smtp => '127.0.0.1', From => 'from@myhost.com', Subject => 'attempt using mail bulkmail', Message => $body{html}, HTML => 1, ); $bulk->mail($toAddy);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending Rich/HTML email
by tachyon (Chancellor) on May 08, 2002 at 07:36 UTC | |
|
Re: Sending Rich/HTML email
by nmerriweather (Friar) on May 08, 2002 at 17:12 UTC |