Subject: | Error attaching multiple files with Net::SMTP::TLS |
Date: | Thu, 02 Dec 2010 11:39:26 +0000 |
To: | bug-Net-SMTP-TLS [...] rt.cpan.org |
From: | Phil Evans <pae9 [...] star.le.ac.uk> |
Hi,
When I try to send an e-mail with multiple attachments through
Net::SMTP::TLS, the attachments get corrupted.
The error can be resolved by adding a single line to TLS.pm (by analogy
with NET::SMTP) -- the error is in the "datasend" subroutine.
Just after line 369 ($len -= $w;) add a new line:
$offset += $w;
And the problem is solved.
N.B. I cannot gaurantee that this corruption always occurs, or is always
solved by this fix. I am generating my email using MIME::Lite, and the
as_string function, and then passing the output from as_string to
Mail::SMTP::Datasend.
Phil Evans
--
-------------------------
Phil Evans,
Swift Development Scientist
X-ray and Observational Astronomy Group,
University of Leicester
Tel: (0116) 252 5059
pae9@star.le.ac.uk
http://www.star.le.ac.uk/~pae9
http://www.swift.ac.uk
Follow me as a Swift scientist on Twitter:
http://www.twitter.com/Swift_Phil
http://www.star.le.ac.uk/~pae9/twitter