use Net::SMTP::Multipart;

E

ecureuil

hi,

I have a problem with this module.

my $filetest = '/tmp/toto.gif';
$smtp->datasend(sprintf( "Attach Message :\n%s\n", $filetest));
$smtp->datasend(" ----------\n\n");

$smtp->FileAttach("$filetest");

$smtp->dataend();
$smtp->quit;

The mail has not attached file...
The FileAttach is in the mail body!

In the received mall:

Attach Message :
'/tmp/toto.gif'
----------

--C0pj9UuwYbRLvwHYYRT4X
Content-Type: ; name="/tmp/toto.gif'"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; =filename="/tmp/toto.gif'"

JSFQUy1BZG9iZS0zLjANCiUlVGl0bGU6ICh0cmF2YXV4X3NhbGxlX2RlX2JhaW5fbW91bC5wZGYp
.....

An Idea?

Thank you
anne
 
U

usenet

ecureuil said:
I have a problem with this module.
The FileAttach is in the mail body!

Hmmm. I've never tried Net::SMTP::Multipart but it looks scarey.

I prefer something like this for sending files via e-mail, which I find
more elegant (and works flawlessly):

use Mail::Sender;
(new Mail::Sender)->MailFile({
'smtp' => 'mail.whatever.com',
'from' => '(e-mail address removed)',
'to' => 'nobody@no_such_domain.com',
'subject' => 'Something for you',
'msg' => 'Here is a file for you.',
'file' => '/path/to/some/file.mp3'
}) || die "Cannot send message: $Mail::Sender::Error\n";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top