Subject: | Large message body also needs to be split into chunks for successfull sending |
Date: | Fri, 25 Sep 2015 00:52:59 +0300 |
To: | bug-email-send-smtp-gmail [...] rt.cpan.org |
From: | Воробьев Дмитрий <v0rd [...] yandex.ru> |
Hi. I've encountered the same problem described in https://rt.cpan.org/Public/Bug/Display.html?id=101832 in case of large message body. According to the source message body is sent "as is" without chunking in 2 places in code:
$self->{sender}->datasend($mail->{body} . "\n\n");
And this will lead to drop of the connection. I've changed these lines to:
my @groups_body = split(/(.{76})/,$mail->{body});
$self->{sender}->datasend($_) foreach @groups_body;
$self->{sender}->datasend("\n\n");
$self->{sender}->datasend($_) foreach @groups_body;
$self->{sender}->datasend("\n\n");
as for the code sending atthachments and this has fixed the problem.
Maybe this should be included in th next version.
Thanks,
Dmitry