in reply to How to send email using Email::MIME & Email::Sender::Simple?
The following code, which is distilled from your example, works fine for me. Just a guess, perhaps you have an old version of one of the modules in one of your many use lib directories? Also, since you seem to be using PAR (I think?), have you tried running the script outside of that?
use warnings; use strict; use Email::MIME; use Email::Sender::Simple 'sendmail'; use Email::Sender::Transport::SMTP; my $message = Email::MIME->create( header_str => [ From => 'test@example.com', To => $ENV{USER}.'@localhost', Subject => 'Happy birthday!', ], attributes => { encoding => 'quoted-printable', charset => 'ISO-8859-1', }, body_str => "Happy birthday to you!\n", ); sendmail($message, { from => 'test@example.com', transport => Email::Sender::Transport::SMTP->new( { host => 'localhost', port => 25 }), });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to send email using Email::MIME & Email::Sender::Simple?
by Magkumar (Novice) on May 03, 2020 at 16:30 UTC | |
by haukex (Archbishop) on May 03, 2020 at 16:41 UTC | |
by Magkumar (Novice) on May 03, 2020 at 16:44 UTC | |
|
Re^2: How to send email using Email::MIME & Email::Sender::Simple?
by Magkumar (Novice) on May 03, 2020 at 16:32 UTC |