Problem using Email::Mailer on laptop

	Is anyone here successfully using Email::Mailer?  I installed it =
using cpanm a couple of days ago on my Mac and I can=E2=80=99t get it to =
work.  It just prints the following output and nothing more:

postdrop: warning: mail_queue_enter: create file maildrop/352468.4276: =
No such file or directory

	It appears to be trying to send it directly from my laptop, but =
I have the SMTP transport variable set up correctly (which works just =
fine using Email::Stuffer, BTW).  I really like what I=E2=80=99ve read =
about this new module - I just need to get past this hurdle.

	Everything installed correctly and there are no error messages, =
so I=E2=80=99m at a loss as to what to try next.

Thanks,
Frank


#!/usr/bin/env perl

use 5.024;
use warnings;

use Email::Mailer;
use Email::Sender::Transport::SMTP;

my $to   =3D =E2=80=98xxx';
my $from =3D =E2=80=98xxx';
my $password =3D =E2=80=98xxx';
my $subject =3D 'Hello';
my $text =3D "This email was sent via Email::Mailer.\n\n";

my $transport =3D Email::Sender::Transport::SMTP->new(
    host          =3D> =E2=80=98my.mail.server.com',
    port          =3D> 587,
    sasl_username =3D> $from,
    sasl_password =3D> $password,
    debug         =3D> 1,
) or die "Error creating multipart container: $!\n";

Email::Mailer->send(
    to        =3D> $to,
    from      =3D> $from,
    subject   =3D> $subject,
    text      =3D> $text,
    transport =3D> $transport,
) or die "Couldn't send email.";=
0
perl
3/20/2017 6:23:39 PM
perl.beginners 29245 articles. 3 followers. Follow

4 Replies
93 Views

Similar Articles

[PageSpeed] 32

> On Mar 20, 2017, at 11:42 AM, Bill <dbecoll@gmail.com> wrote:
>=20
> Not available to me via AS PPM, suggest you try MIME::Lite instead.

	MIME::Lite is not recommended by its current maintainer.

	I don=92t use ActivePerl, so I don=92t know why PPM wouldn=92t =
include it.  Perhaps it=92s too new?  Is anyone familiar with Gryphon =
Shafer=92s work?

https://metacpan.org/pod/Email::Mailer

Frank=
0
perl
3/20/2017 7:04:34 PM
> On Mar 20, 2017, at 12:04 PM, SSC_perl <perl@surfshopcart.com> wrote:
>=20
> Is anyone familiar with Gryphon Shafer=92s work?

	After hitting the send button, my last question didn=92t sit =
right with me.  It kind of sounds like I was questioning his work, which =
I wasn=92t. =20

	I did some digging and found that Gryphon has been a pretty =
prolific contributor to CPAN since 2015 - 30 modules in all.  I like his =
pod writeup on Email::Mailer - it=92s very comprehensive, straight =
forward, and easy to understand.  And after browsing the source code, I =
like his coding style, too.

	He also lives in my neck of the woods, and he=92s a pilot!!!  =
How cool is that??? :)  I wonder if he belongs to SPUG? ;)

	So my question goes back to the original - why wouldn=92t this =
work from a local install?  Could I be missing some component without =
knowing it?

Frank=
0
perl
3/20/2017 7:44:18 PM
On Mon, 20 Mar 2017 11:23:39 -0700
SSC_perl <perl@surfshopcart.com> wrote:

> 	Is anyone here successfully using Email::Mailer?  I installed
> it using cpanm a couple of days ago on my Mac and I can=E2=80=99t get it =
to
> work.  It just prints the following output and nothing more:
>=20
> postdrop: warning: mail_queue_enter: create file
> maildrop/352468.4276: No such file or directory
>=20
> 	It appears to be trying to send it directly from my laptop,
> but I have the SMTP transport variable set up correctly (which works
> just fine using Email::Stuffer, BTW).  I really like what I=E2=80=99ve re=
ad
> about this new module - I just need to get past this hurdle.

I think you found a bug in Email::Mailer.

Looking at its code, it sends the mail by calling
Email::Sender::Simple, as :

    # send the email with Email::Sender::Simple
    sendmail( $email_mime, $mail->{transport} );

but looking at Email::Sender::Simple->send_email(), :

    sub send_email {
        my ($class, $email, $arg) =3D @_;
=20
        my $transport =3D $class->default_transport;
=20
        if ($arg->{transport}) {
            ...

So, Email::Sender::Simple->send_email() is expecting the second
parameter passed to it to be a hashref containing a 'transport' key,
but it's getting passed an Email::Sender::Transport::SMTP object
instead, and ignoring it.

I've taken the liberty of raising this on Github for you, since I'd
already done the digging and found the code in question, so it was just
as easy to more or less copy & paste this reply into a ticket:
https://github.com/gryphonshafer/Email-Mailer/issues/1


Cheers

Dave P  (BIGPRESH)
0
davidp
3/21/2017 12:53:34 AM
> I've taken the liberty of raising this on Github for you, since I'd
> already done the digging and found the code in question, so it was =
just
> as easy to more or less copy & paste this reply into a ticket:
> https://github.com/gryphonshafer/Email-Mailer/issues/1

	Thank you for that, Dave.  He fixed it in record time!  The =
latest version works as it should.  I had also installed it on my server =
where it worked fine, but it=E2=80=99s nice to be able to use it =
locally, too.

Frank=
0
perl
3/21/2017 3:37:45 AM
Reply: