
xmaverick
User
Aug 19, 2009, 10:39 AM
Post #6 of 37
(27362 views)
|
Re: [KevinR] Sending Attachment using MIME::Lite
[In reply to]
|
Can't Post
|
|
Interesting. I modify the script as the following now and i incorporated your suggestions. #!/usr/bin/perl -w use warnings; use MIME::Lite; use Net::SMTP; use strict; my $msg = MIME::Lite->new( From => 'elliot.anico@cellularatsea.com', To => 'elliot.anico@cellularatsea.com', cc => 'wms.nmc@cellularatsea.com', Subject => 'Multiple attachments', Type => 'multipart/mixed'); $msg->attach( Type =>'image/jpg', Path =>'/export/home/omcadmin/bin/Sunset.jpg', Filename =>'Sunset.jpg'); $msg->attach( Type =>'image/jpg', Path =>'/export/home/omcadmin/bin/Winter.jpg', Filename =>'Winter.jpg'); $msg->attach( Type =>'TEXT', Data =>'This is a test for outside usage'); my $SMTP_SERVER = 'wmsexg01.corp.cellularatsea.com'; MIME::Lite->send('smtp', $SMTP_SERVER); $msg ->send(); However, i now receive the following error: SMTP MAIL command failed: 5.7.1 Helo invalid . at attach1.pl line 31 In the script line 31 is the following: $msg ->send(); What do you think?
|