A
Andy
I'm using the perl module Email::Send to generate email. In my tests,
the send function executes and no errors are thrown. But, even though
I'm sending the email to myself through my local SMTP email server to
my local exchange server, nothing seems to happen.
I'm also using Email::MIME and Email::MIME::Creator to build the email
headers.
Does anyone have any suggestions on what is going wrong or how to
diagnose the problem?
Here's the code I'm calling to send the email:
#SendEmail($html,$text,$sender,$recipient,$subject,$smtpserver);
sub SendEmail{
($html,$text,$sender,$recipient,$subject,$smtpserver)=@_;
@multipart = (
Email::MIME->create(
attributes => {
content_type => "text/plain",
format => "flowed",
charset => "US-ASCII",
},
body => $text,
),
Email::MIME->create(
attributes => {
content_type => "text/html",
charset => "US-ASCII",
encoding => "quoted-printable",
format => "flowed",
},
body => $html,
),
);
$email = Email::MIME->create(
header => [ From => $sender ],
parts => [ @multipart ],
);
$email->header_set( To => $recipient );
$email->header_set( Subject => $subject );
$email->header_set( 'Content-Type' => 'multipart/alternative' );
$email->boundary_set('INFOTEK_Boundary_text');
$mailer = Email::Send->new({mailer => 'SMTP'});
$mailer->mailer_args([Host => "$smtpserver"]);
$mailer->send($email);
}
the send function executes and no errors are thrown. But, even though
I'm sending the email to myself through my local SMTP email server to
my local exchange server, nothing seems to happen.
I'm also using Email::MIME and Email::MIME::Creator to build the email
headers.
Does anyone have any suggestions on what is going wrong or how to
diagnose the problem?
Here's the code I'm calling to send the email:
#SendEmail($html,$text,$sender,$recipient,$subject,$smtpserver);
sub SendEmail{
($html,$text,$sender,$recipient,$subject,$smtpserver)=@_;
@multipart = (
Email::MIME->create(
attributes => {
content_type => "text/plain",
format => "flowed",
charset => "US-ASCII",
},
body => $text,
),
Email::MIME->create(
attributes => {
content_type => "text/html",
charset => "US-ASCII",
encoding => "quoted-printable",
format => "flowed",
},
body => $html,
),
);
$email = Email::MIME->create(
header => [ From => $sender ],
parts => [ @multipart ],
);
$email->header_set( To => $recipient );
$email->header_set( Subject => $subject );
$email->header_set( 'Content-Type' => 'multipart/alternative' );
$email->boundary_set('INFOTEK_Boundary_text');
$mailer = Email::Send->new({mailer => 'SMTP'});
$mailer->mailer_args([Host => "$smtpserver"]);
$mailer->send($email);
}