use Net::SMTP::Multipart;

Discussion in 'Perl Misc' started by ecureuil, May 21, 2006.

  1. ecureuil

    ecureuil Guest

    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
    ecureuil, May 21, 2006
    #1
    1. Advertising

  2. ecureuil

    Guest

    ecureuil wrote:
    > 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' => '',
    '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";

    --
    http://DavidFilmer.com
    , May 21, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. c# newbie
    Replies:
    3
    Views:
    5,875
  2. Replies:
    3
    Views:
    1,052
    Roedy Green
    Jan 24, 2006
  3. Alex Hunsley
    Replies:
    4
    Views:
    3,416
    Tim Williams (gmail)
    Jun 29, 2004
  4. ecureuil

    problem with Net::SMTP::Multipart

    ecureuil, May 25, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    149
    ecureuil
    May 27, 2006
  5. Replies:
    1
    Views:
    390
Loading...

Share This Page