I am trying to send a test e-mail with the following Perl script.
use strict; use warnings; use MIME::Entity; my $From = '<valid e-mail address>'; my $To = '<valid e-mail address>'; my $Subject = 'Test'; my $Type = 'text/plain'; my $Host = 'mail.btinternet.com'; my $msg = MIME::Entity->build( From => $From, To => $To, Subject => $Subject, Type => $Type, Data => 'This is a test message', Debug => 1 ); print "\nbefore smtpsend\n\n"; my @ok = $msg->smtpsend( Host => $Host, To => $To, Debug => 1 ); if (@ok) { print "Sent message to: ", join(', ', @ok), "\n"; } else { print "\nFailed to send message"; }
I am fairly sure that something very similar worked on my system some years ago. However, since then I have:
1. started to use Thunderbird as my e-mail application;
2. started to use Virgin Media to give broadband and internet services but I have retained by bt e-mail address.
Using this script I get the following output.

before smtpsend

Net::SMTP>>> Net::SMTP(2.31)
Net::SMTP>>> Net::Cmd(2.29)
Net::SMTP>>> Exporter(5.68) )
Net::SMTP>>> IO::Socket::INET(1.33) )
Net::SMTP>>> IO::Socket(1.37) )
Net::SMTP>>> IO::Handle(1.34) )
Net::SMTP=GLOB(0x25d4468)<<< 220 rgout03.bt.lon5.cpcloud.co.uk ESMTP Service ready)
Net::SMTP=GLOB(0x25d4468)>>> EHLO localhost.localdomain)
Net::SMTP=GLOB(0x25d4468)<<< 250-rgout03.bt.lon5.cpcloud.co.uk)
Net::SMTP=GLOB(0x25d4468)<<< 250-DSN)
Net::SMTP=GLOB(0x25d4468)<<< 250-8BITMIME)
Net::SMTP=GLOB(0x25d4468)<<< 250-PIPELINING)
Net::SMTP=GLOB(0x25d4468)<<< 250-AUTH=LOGIN)
Net::SMTP=GLOB(0x25d4468)<<< 250-AUTH LOGIN PLAIN)
Net::SMTP=GLOB(0x25d4468)<<< 250-DELIVERBY 300)
Net::SMTP=GLOB(0x25d4468)<<< 250 SIZE 41943040)
Net::SMTP=GLOB(0x25d4468)>>> MAIL FROM:<postmaster@hm-insp15>)
Net::SMTP=GLOB(0x25d4468)<<< 553 <postmaster@hm-insp15> Invalid mail address, must be fully qualified domain)
Net::SMTP=GLOB(0x25d4468)>>> QUIT)
Net::SMTP=GLOB(0x25d4468)<<< 221 rgout03.bt.lon5.cpcloud.co.uk QUIT)

Failed to send message

It seems that postmaster@hm-insp15 is not correct. What can I do to correct this?

In reply to e-mail fails with address that is not a fully qualified domain by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.