in reply to Re: EMail problem in outlook
in thread EMail problem in outlook

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";

Replies are listed 'Best First'.
Re^3: EMail problem in outlook
by chandanperl (Novice) on Aug 25, 2009 at 12:47 UTC
    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

        #!/usr/bin/perl use MIME::Lite; use Mail::Sender; open(FH,"file.txt"); while(<FH>) { $var = $_; print "$var\n"; } close(FH); eval { Mail::Sender->new( {from => '', smtp => ''}) ->OpenMultipart({ to => '', subject => 'Subject Here!', multipart => 'related', }) ->Part({ ctype => 'text/html', disposition => 'NONE', msg => $var}) ->Close(); } or print "Error sending mail: $Mail::Sender::Error\n";