Mail::Bulkmail - multipart breaks when doing mail merge

P

Patrick

Hi, I've been using Mail::Bulkmail for a while now but never had to do
both a mail merge and mutlipart togeather. I recently wrote a program
that SHOULD send a multipart email and do a mail merge. Both of these
work fine separately, however, when i do a mailmerge, multipart breaks
and sends the message like it was text. I even checked the header to
the sent email and indeed it does have content-type: text/plain. I'm
using Mail::Bulkmail v3.12 (latest) Here is my code:

my $server = Mail::Bulkmail::Server->new('Smtp' => "localhost",
'Domain' => "localhost",
"Port" => 25
) || die
Mail::Bulkmail::Server->error();

$server->max_connection_attempts(2);
$server->Tries(5);
$server->connect()||die "Couldn't connect";

my $message = ("MIME-Version: 1.0\n".
"Content-type: multipart/alternative; boundary =
$BOUNDARY\n\n".
"--$BOUNDARY\n".
"Content-type: text/plain; charset=ISO-8859-1\n\n".
"$message_text\n\n".
"--$BOUNDARY\n".
"Content-type: text/html; charset=ISO-8859-1\n".
"Content-Transfer-Encoding:
7bit\n\n$message_html\n\n");

my $bulk = Mail::Bulkmail::Dynamic->new(
"LIST" => \@data,
"From" => $from,
"ReplyTo" =>
$replyto,
"Subject" =>
$subject,
"headers_from_message" =>
1,
"Message" =>
$message,
"merge_keys" =>
\@merge_keys,
"servers" =>
[$server],
) || die
Mail::Bulkmail->error();

This does the mailmerge just fine, however it sends the message as
plain text?!?!

When i comment out the line merge_keys and replace LIST with:
"LIST" =>['(e-mail address removed)']

in the bulk objectIt sends the multipart message just fine (of course,
i no longer have a mail merge). How do i do both of these things to
work togeather? Am i doing something wrong? Please let me know
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top