| re: Sending Attachment using MIME::Lite
I see. well, i managed to modify my script but i'm having problems attempting to send the email via Net::SMTP. I keep receiving the following error when i execute the script:
SMTP MAIL command failed:
5.7.1 Helo invalid .
at attach1.pl line 30
This is the very last line in the script below which is
$msg -> send;
Below is my modified script:
#!/usr/bin/perl -w
use warnings;
use MIME::Lite;
use Net::SMTP;
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');
$SMTP_SERVER = 'wmsexg01.corp.cellularatsea.com';
MIME::Lite->send('smtp', 'SMTP_SERVER');
$msg -> send;
What could i be doing wrong?
|