i can't, for the life of me, get this done right. I dunno whats going wrong. Looking at the email source, it looks as i believe it shoud -- but when it hits the yahoo/hotmail accounts, i just get 'content type=text/html' - as the body of the whole damn thing. sometimes i'll see that, and if i look at the source, it exhibits object/embed tags as xobject or xembed, rendering them useless (i've got a flash movie hardcoded to a url in there)
i tried using Mime:Lite, but i had too many configuration problems..
any help would be GREATLY appreciated
sub 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);
}
or
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);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.