Hello,
I'm a newbie perl scriptor and i'm trying to figure out why i can't send an email using MIME::Lite with Net::SMTP. I keep receiving the following error:
SMTP MAIL command failed:
5.7.1 Helo invalid .
at attach1.pl line 31
The error keeps coming from the very last line of my script. It seems like a syntax error but i'm stuck. The last line is:
$msg ->send();
Below is my script:
#!/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();
Can anybody assist me?