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;
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;