merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

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.

Replies are listed 'Best First'.
Re: SMTP e-mail 530 authenication problem
by Anonymous Monk on Jun 19, 2009 at 11:40 UTC
    Does any wiser Monk that I know what should be done to cure this issue?

    Authenticate.

    $smtp->auth ( USERNAME, PASSWORD );
      I tried using ->auth but so far just a return of zero.
      For the name and password arguments I wrote both in 'clear' text.
      Passwords always seem to be shown as *. Is there something I should do so that this is how the password is seen in the Perl code?
      I am sure both are correct since I verified them using the Accounts functions for my e-mail.
      For SMPT modules I have just called use Net::SMTP;
      Is there anything else I must have before this will work?
        Passwords always seem to be shown as *.

        They should always be shown as *.

        Is there anything else I must have before this will work?

        For start, show/examine debug output, it should say why auth failed.