Switching over to Net::SMTP::SSL from MIME::Lite has been slightly problematic. The issue I am now facing is that when using MIME::Lite I was able to easily send HTML in the body but now with NET:SMTP it is failing when it comes to adding the html to the body of the message
sub sendMail{ my $receiver = shift; my $body = shift; my $subject = "Sociabull Weekly"; print "Sending to $receiver\n"; $smtp->mail($connect{sender}); $smtp->recipient($receiver); $smtp->data() or die "Failed to send! - Data initialize : $!\n"; $smtp->datasend("To: <$receiver> \n") or die "Failed to send! -- T +o : $!\n"; $smtp->datasend("From: $connect{sender_name} <$connect{sender}> \n +") or die "Failed to send! -- From : $!\n"; $smtp->datasend("Content-Type: text/html \n") or die "Failed to se +nd! -- Content-Type : $!\n"; $smtp->datasend("Subject: $subject\n") or die "Failed to send! - S +ubject : $!\n"; $smtp->datasend("\n") or die "Failed to send! - Line Break : $!\n" +; $smtp->datasend($body) or die "Failed to send! - Body : $!\n"; $smtp->datasend("\n") or die "Failed to send! - After Body Break : + $!\n"; $smtp->dataend() or die "Failed to send! - Data End : $!\n"; }
If I print out the contents of the variable $body the html is definitely there but when it gets to the "$smtp->datasend($body) or die "Failed to send! - Body : $!\n";" line, it fails. It looks like I have the Content type set properly so once again I am asking for your expertise.
Thanks again, as alwaysIn reply to Net::SMTP::SSL - sending HTML by edimusrex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |