problem with Net::Smtp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neog
    New Member
    • Oct 2006
    • 1

    problem with Net::Smtp

    I'm having a problem with Net::Smtp. Does the datasend() method have problems sending strings containing single quotes?

    Like I stored the string "Germany's biggest bank, hired" in a hash and it prints out fine when i retrieve the scalar value.
    But i do datasend($msg) and when i open the email I see something like "Germany's bigges! t bank, hired". These "!" are popping all over the place.

    Any thoughts would be greatly appreciated.
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    No it doesn't have a problem with single quotes. I suppose that the lines of your body are simply too long, and therefore they are being truncated. I cannot predict exactly what your problem is, so I would suggest that you attempt a solution by using MIME::Lite in combination with Net::SMTP.

    Code:
    # Create Message
    my $msg = MIME::Lite->new(@content);
    
    # Send E-mail
    my $smtp = Net::SMTP->new($MAIL_SERVER,
    	Hello	=> $MAIL_SERVER,
    	Port	=> $MAIL_PORT,
    );
    $smtp->mail($from);
    $smtp->recipient(@recipients, { SkipBad => 1});
    
    $smtp->data($msg->as_string());
    $smtp->dataend();

    Comment

    Working...