I am still having trouble getting e-mail to work using Net::SMTP.Following an earlier Monk’s advice I added a debug in the code (new version in this e-mail).This showed that the MAIL FROM failed because 530 authentication required and referred me to the SMTP authentication tick box.I checked in the Outgoing Server tab frame of the E-mail-Setting GUI and found that it was ticked.
I also found that if I unticked this box I could not send the e-mail test message (error text at the end of this).I am sure that the e-mail address I am trying to use for the FROM is correct since I copied and pasted this from the e-mail accounts GUI.
I have looked on both the internet and searched Monk’s pages but while there are some references to this problem I could not find a solution.
Does any wiser Monk that I know what should be done to cure this issue?
It would be good to hear from a Monk who has successfully used this method with the btinternet.com server in case there is something ‘special’ that is required. For example, on the Outgoing Server tab frame there are other options which I have left unselected.
There is a 2nd error shown about an unexpected EOF on the command channel.It would help to know if this really is a problem or a consequence of the authentication error
use strict "vars";
use MIME::Entity;
use Net::SMTP;
my ($servername, $smtp, $mail_res, $mail_from, $mail_to);
my $servername = "mail.btinternet.com";
use Net::SMTP;
$smtp = 'start';
print "smtp <$smtp> trying to connect to <$servername>\n";
# Connect to the server
$smtp = Net::SMTP->new($servername, Debug => 1);
if($smtp =~ m/SMTP\=/) {
print "\nconnected to mail server <$servername>\n";
print "smtp->domain <$smtp->domain>\n";
$mail_from = 'copied e-mail address';
$mail_res = $smtp->mail($mail_from);
print "\nafter ->mail result <$mail_res> for <$mail_from>\n\n";
$mail_to = $mail_from;
$smtp->recipient($mail_to);
print "\nafter ->recipient\n\n";
} else {
print "could NOT connect to mail server <$servername>\n";
}
smtp <start> trying to connect to <mail.btinternet.com>
Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>> Net::Cmd(2.26)
Net::SMTP>>> Exporter(5.58)
Net::SMTP>>> IO::Socket::INET(1.29)
Net::SMTP>>> IO::Socket(1.29)
Net::SMTP>>> IO::Handle(1.25)
Net::SMTP=GLOB(0x1ba333c)<<< 220 smtp809.mail.ird.yahoo.com ESMTP
Net::SMTP=GLOB(0x1ba333c)>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x1ba333c)<<< 250-smtp809.mail.ird.yahoo.com
Net::SMTP=GLOB(0x1ba333c)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE
Net::SMTP=GLOB(0x1ba333c)<<< 250-PIPELINING
Net::SMTP=GLOB(0x1ba333c)<<< 250 8BITMIME
connected to mail server <mail.btinternet.com>
smtp->domain <Net::SMTP=GLOB(0x1ba333c)->domain>
Net::SMTP=GLOB(0x1ba333c)>>> MAIL FROM:<e-mail address>
Net::SMTP=GLOB(0x1ba333c)<<< 530 authentication required - "Your email could not be sent. To fix this you must make a simple change to your email (known as SMTP authentication). For advice visit www.btyahoo.com/smtp"
after ->mail result <> for <e-mail address>
Net::SMTP=GLOB(0x1ba333c)>>> RCPT TO:<e-mail address>
Net::SMTP: Unexpected EOF on command channel at after ->recipient
This is the error I got when I had unticked the SMTP boxand tried to send a test e-mail.
Send test e-mail message: Cannot send the message. Verify the e-mail address in your account properties.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.