Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Error at during DATA / Email::Sender::Transport::SMTP

by talexb (Chancellor)
on Jun 14, 2024 at 14:16 UTC ( [id://11159987]=perlquestion: print w/replies, xml ) Need Help??

talexb has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting this error when trying to send an E-Mail using sendmail ..

    Email::Sender::Transport::SMTP::_throw('Email::Sender::Transport::SMTP +=HASH(0x564b90f0b378)', 'error at during DATA', 'Net::SMTP::_SSL=GLOB +(0x564b8e0b7f10)') called at /usr/local/share/perl/5.34.0/Email/Sende +r/Transport/SMTP.pm line 270
I'm a little puzzled, because I send other, similar messages using this module, and they all work fine. My only hypothesis is that the message might be too large for Outlook to handle. I see that there's a _hunk_size hard-coded to 2**20, and wonder if I could try reducing that hunk size to get this through.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re: Error at during DATA / Email::Sender::Transport::SMTP
by marto (Cardinal) on Jun 14, 2024 at 14:48 UTC

    Outlook is a client, not a mail server. Is this happening for a particular recipient? If so are there any 'special' characters in their email address or name? Can you show the code rather than the error message?

      Sorry -- I'm using smtp.office365.com, port 587 as the SMTP server .. I think of that as Outlook.

      I'm generating a report by sending a bunch of query results to Template::Toolkit process, then I'm sending the result. I just did a test run, and the output file (a web page) was 835K, so not huge. This is the code that sends the message, using ymd as the date and output as the output from the TT2 process:

        my $message = Email::Simple::Markdown->create( header => [ Subject => "Sage IC Issues to be fixed / $ymd", To => $list, Bcc => 'talexb@foobar.com', From => 'noreply@foobar.com' ], body => $output ); defined $message or die "Could not create message!"; try { sendmail( $message, { from => 'noreply@foobar.com', transport => Email::Sender::Transport::SMTP->new( { host => $EMail::Host, port => $EMail::Port, sasl_username => $EMail::User, sasl_password => $EMail::Password, ssl => 'starttls', } ) } ); } catch { warn "sending failed: $_"; };
      The complete error listing is here:
        sending failed: error at during DATA: [Net::SMTP::_SSL] Connection clo +sed Trace begun at /usr/local/share/perl/5.34.0/Email/Sender/Transport/SMT +P.pm line 259 Email::Sender::Transport::SMTP::_throw('Email::Sender::Transport::SMTP +=HASH(0x5591af605fd8)', 'error at during DATA', 'Net::SMTP::_SSL=GLOB +(0x5591b02e7890)') called at /usr/local/share/perl/5.34.0/Email/Sende +r/Transport/SMTP.pm line 270 Email::Sender::Transport::SMTP::__ANON__('error at during DATA') calle +d at /usr/local/share/perl/5.34.0/Email/Sender/Transport/SMTP.pm line + 324 Email::Sender::Transport::SMTP::send_email('Email::Sender::Transport:: +SMTP=HASH(0x5591af605fd8)', 'Email::Abstract=ARRAY(0x5591afd2b280)', +'HASH(0x5591afdc3f30)') called at /usr/local/share/perl/5.34.0/Email/ +Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/local/share/per +l/5.34.0/Try/Tiny.pm line 102 eval {...} at /usr/local/share/perl/5.34.0/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x5591b02de808)', 'Try::Tiny::Catch=REF(0x5591afd +cfb90)') called at /usr/local/share/perl/5.34.0/Email/Sender/Role/Com +monSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SM +TP=HASH(0x5591af605fd8)', 'Email::Abstract=ARRAY(0x5591afd2b280)', 'H +ASH(0x5591b02de418)') called at /usr/local/share/perl/5.34.0/Email/Se +nder/Simple.pm line 119 Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abs +tract=ARRAY(0x5591afd2b280)', 'HASH(0x5591afdc3c90)') called at /usr/ +local/share/perl/5.34.0/Email/Sender/Role/CommonSending.pm line 45 Email::Sender::Role::CommonSending::try {...} at /usr/local/share/per +l/5.34.0/Try/Tiny.pm line 102 eval {...} at /usr/local/share/perl/5.34.0/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x5591afdc3fd8)', 'Try::Tiny::Catch=REF(0x5591afc +c9ea8)') called at /usr/local/share/perl/5.34.0/Email/Sender/Role/Com +monSending.pm line 58 Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Ema +il::Simple::Markdown=HASH(0x5591afcc2fc0)', 'HASH(0x5591af605f30)') c +alled at /usr/local/share/perl/5.34.0/Sub/Exporter/Util.pm line 57 Sub::Exporter::Util::__ANON__('Email::Simple::Markdown=HASH(0x5591afcc +2fc0)', 'HASH(0x5591af605f30)') called at sage_issues.pl line 175 main::try {...} at /usr/local/share/perl/5.34.0/Try/Tiny.pm line 102 eval {...} at /usr/local/share/perl/5.34.0/Try/Tiny.pm line 93 Try::Tiny::try('CODE(0x5591afcb89c0)', 'Try::Tiny::Catch=REF(0x5591ad4 +ae5a0)') called at script.pl line 42

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

        What does the SMTP server complain about that causes E'S'T'SMTP to croak? That is say log for the exchange between the client & server is missing.

Re: Error at during DATA / Email::Sender::Transport::SMTP
by jo37 (Deacon) on Jun 14, 2024 at 19:56 UTC

    I'm afraid there are different measures. Wouldn't any new user be grilled here when providing such incomplete information?

    Greetings,
    🐻

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11159987]
Approved by stefbv
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (10)
As of 2024-07-12 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.