#!/usr/bin/perl use Mail::Sender; $sender = new Mail::Sender {smtp => 'MSEXCHANGE_SERVER_IP', from => ''}; $recipients = ""; $user = ""; $pass = ""; @protocols = $sender->QueryAuthProtocols(); $size = scalar @protocols; if($size > 0) { foreach $protocols(@protocols) { $authtype = "$protocols"; } $sender = new Mail::Sender{smtp => 'MSEXCHANGE_SERVER_IP', from => '', + debug => "", debug_level => 4, auth => "$authtype", authid => "$user +", authpwd => "$pass"}; if (ref $sender->OpenMultipart({ from => '', to => $recipients, subject => 'Embedded Image Test', boundary => 'boundary-test-1', multipart => 'related'})) { $sender ->Attach( {description => 'html body', ctype => 'text/html; charset=us-ascii', disposition => 'inline', file => 'file.html', }); $sender->Attach({ description => 'ed\'s gif', ctype => 'image/gif', encoding => 'base64', disposition => "inline; filename=\"logo.gif\"; +\r\nContent-ID: <logo.gif>", file => 'logo.gif' }); $sender->Close() or die "Close failed! $Mail::Sender::Error\n"; } else { die "Cannot send mail: $Mail::Sender::Error\n"; } } else { }
In reply to Re^2: Sending Email to Exchange server from linux box
by chandanperl
in thread Sending Email to Exchange server from linux box
by chandanperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |