Using Email::Send::SMTP with authentication

B

Bob

Hello, all...

I am trying to send email messages via a remote SMTP server using the
Email::Send::SMTP module. It's _almost_ (I think) working, but I can't
get past the authentication. The error message is "Couldn't
authenticate 'myaccount:...' at emailtest.pl line 27" (the line with
the call to send()). Probably a dumb mistake on my part. Can anyone
offer guidance? My test code is below.

Thanks!

Bob

#!/usr/bin/perl

use strict;

use Email::Send;
use Email::Send::SMTP;

my $msg = Email::Send->new({mailer => 'SMTP'});
$msg->mailer_args([
header => [
To => '(e-mail address removed)',
Subject => 'email test',
From => '(e-mail address removed)'],
attributes => {'content_type' => 'text/html'},
body => 'This is a test']);

my $retval = Email::Send::SMTP->send(
$msg,
Host => 'smtp.mydomain.com',
username => 'myaccount',
password => 'mypassword');

die "$retval" if ! $retval;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top