in reply to EMail problem in outlook

What part of your code does not work? For attachments set disposition => 'attachment; filename=*' and for inline set disposition => 'inline; filename=*'. If you need to send a file as the message body, set disposition => 'NONE'. This is from the Mail::Sender documentation. Also for reference Content disposition Types

Also note that you need to set a Content-ID on any resources you need to refer to in your body (like images), e.g.:
disposition => "inline; filename => \"img.gif";\r\nContent-ID: <img>",

Replies are listed 'Best First'.
Re^2: EMail problem in outlook
by james2vegas (Chaplain) on Aug 25, 2009 at 12:15 UTC
    Work off this if you still have no luck:
    use Mail::Sender; eval { Mail::Sender->new( {from => 'user@domain.local', smtp => 'mailserver.domain.local'}) ->OpenMultipart({ to => 'user@domain.remote', subject => 'Subject Here!', multipart => 'related', }) ->Part({ ctype => 'text/html', disposition => 'NONE', msg => <<'*END*'}) <html><body> This is where your HTML Page will be <img src="cid:img1"> </body></html> *END* ->Attach({ description => 'image descr', ctype => 'image/jpeg', encoding => 'base64', disposition => "inline; filename=*;\r\nContent-ID: <img1>", file => '/path/to/image.jpg' }) ->Close(); } or print "Error sending mail: $Mail::Sender::Error\n";
      Hey, I have changed your code accordingly but i am not able to send emails to any account

        Jenda has already suggested you learn how to debug code in one of the other threads you started on this same subject. Debuging is an essential skill if you work with code for a living.

        To do this effectively you need to be comfortable with the technologies you are using in order to resolve problems with minimal effort. If you don't take the time to learn the tools and technologies you are working with, you only make your task harder.

        Martin

Re^2: EMail problem in outlook
by chandanperl (Novice) on Aug 25, 2009 at 11:43 UTC
    #!/usr/bin/perl use Mail::Sender; $sender = new Mail::Sender ######### MS Exchange SMTP server #################### {smtp => '', from => ''}; $recipients = ""; if (ref $sender->OpenMultipart({ from => '', to => $recipients, subject => 'chandan Embedded Image Test', boundary => 'boundary-test-1', multipart => 'related'})) { ##################### I have to send this part msg as inline ######### +############# $sender ->Attach( {description => 'html body', ctype => 'text/html; charset=us-ascii', #encoding => '7bit', disposition => 'NONE', file => 'file2.html', }); ################### I have to send this part msg as Attachment ###### +############### $sender ->Attach( {description => 'html body', ctype => 'text/html; charset=us-ascii', #ctype => 'text/html', #encoding => '7bit', #disposition => 'inline', file => 'auth_sasl.pl', }); $sender->Close() or die "Close failed! $Mail::Sender:: +Error\n"; } else { die "Cannot send mail: $Mail::Sender::Error\n"; } exit;