I m trying to send email using MIME lite as below
Code:
#! /usr/bin/perl -w
use MIME::Lite;
use Net::SMTP;
### Adjust sender, recipient and your SMTP mailhost
my $from_address = 'am@gogo.biz';
my $to_address = 'ana@gogo.biz';
my $mail_host = 'gogo.biz';
my $authUser = 'app';
my $authPass = 'app123';
### Adjust subject and body message
my $subject = 'mail testing from 129 ';
my $message_body = "Here's the attachment file(s) you wanted";
### Adjust the filenames
my $my_file_gif = 'my_file.gif';
my $your_file_gif = 'your_file.gif';
my $my_file_zip = 'my_file.zip';
my $your_file_zip = 'your_file.zip';
### Create the multipart container
$msg = MIME::Lite->new (
From => $from_address,
To => $to_address,
Subject => $subject,
Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";
### Add the text message part
$msg->attach (
Type => 'TEXT',
Data => $message_body
) or die "Error adding the text message part: $!\n";
### Send the Message
MIME::Lite->send('smtp', $mail_host, AuthUser=>$authUser, AuthPass=>$authPass)|| die "Cannot send email\n";
$msg->send_by_smtp($mail_host);
But Everytime i run the script i get this error message as below
SMTP RCPT command failed:
5.0.0 <ana@gogo.biz>... Use MXes or authenticate yourself
I am very sure the username and password is correct because if i telnet to my STMP hostname and send email using SMTP command it works.
any idea guys?