Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl: the Markov chain saw
 
PerlMonks  

Sending mail via godaddy

by DanEllison (Sexton)
on Jan 20, 2012 at 14:50 UTC ( #948978=perlquestion: print w/ replies, xml ) Need Help??
DanEllison has asked for the wisdom of the Perl Monks concerning the following question:

I have a site hosted by GoDaddy with e-mail accounts. I'm trying to send out an e-mail using Perl from my desktop, not from my host, and the outgoing e-mail appears to be sending, but is never received at the destination.

I should think if Outlook can do it, I should be able to do it.

Following is the code I am using with the debugging output following that.

#! /usr/bin/perl use strict; use Net::SMTP::SSL; my $smtp = Net::SMTP::SSL->new('smtpout.secureserver.net', Port => 465 +, Hello => 'mydomain.org', Debug => 1) or die $!; defined($smtp->auth('me@mydomain.org', 'xxxxxxxx')) or die $!; $smtp->mail('me@mydomain.org') or die $!; $smtp->to('them@theirdomain.com') or die $!; $smtp->data or die $!; $smtp->datasend("From: me\@mydomain.org") or die $!; $smtp->datasend("To: them\@theirdomain.com") or die $!; $smtp->datasend("Subject: This is a test") or die $!; $smtp->datasend("\n") or die $!; $smtp->datasend("This is test #1.\n") or die $!; $smtp->dataend or die $!; $smtp->quit or die $!; exit;
Net::SMTP::SSL>>> Net::SMTP::SSL(1.01) Net::SMTP::SSL>>> IO::Socket::SSL(1.22) Net::SMTP::SSL>>> IO::Socket::INET(1.31) Net::SMTP::SSL>>> IO::Socket(1.31) Net::SMTP::SSL>>> IO::Handle(1.28) Net::SMTP::SSL>>> Exporter(5.63) Net::SMTP::SSL>>> Net::Cmd(2.29) Net::SMTP::SSL=GLOB(0x353486c)<<< 220 p3plsmtpa01-06.prod.phx3.secures +erver.net ESMTP Net::SMTP::SSL=GLOB(0x353486c)>>> EHLO mydomain.org Net::SMTP::SSL=GLOB(0x353486c)<<< 250-p3plsmtpa01-06.prod.phx3.secures +erver.net Net::SMTP::SSL=GLOB(0x353486c)<<< 250-AUTH LOGIN PLAIN Net::SMTP::SSL=GLOB(0x353486c)<<< 250-8BITMIME Net::SMTP::SSL=GLOB(0x353486c)<<< 250 PIPELINING Net::SMTP::SSL=GLOB(0x353486c)>>> AUTH LOGIN Net::SMTP::SSL=GLOB(0x353486c)<<< 235 Authentication succeeded. Net::SMTP::SSL=GLOB(0x353486c)>>> MAIL FROM:<me@mydomain.org> Net::SMTP::SSL=GLOB(0x353486c)<<< 250 Sender accepted. Net::SMTP::SSL=GLOB(0x353486c)>>> RCPT TO:<them@theirdomain.com> Net::SMTP::SSL=GLOB(0x353486c)<<< 250 Recipient accepted. Net::SMTP::SSL=GLOB(0x353486c)>>> DATA Net::SMTP::SSL=GLOB(0x353486c)<<< 354 End your message with a period. Net::SMTP::SSL=GLOB(0x353486c)>>> From: me@mydomain.org Net::SMTP::SSL=GLOB(0x353486c)>>> To: them@theirdomain.com Net::SMTP::SSL=GLOB(0x353486c)>>> Subject: This is a test Net::SMTP::SSL=GLOB(0x353486c)>>> This is test #1. Net::SMTP::SSL=GLOB(0x353486c)>>> . Net::SMTP::SSL=GLOB(0x353486c)<<< 250 Accepted message qp 26296 bytes +251 Net::SMTP::SSL=GLOB(0x353486c)>>> QUIT Net::SMTP::SSL=GLOB(0x353486c)<<< 221 Good bye.

Comment on Sending mail via godaddy
Select or Download Code
Re: Sending mail via godaddy
by DanEllison (Sexton) on Jan 20, 2012 at 15:11 UTC

    I just love how this site works. I screw with this thing for two days, post my question, and then solve it myself five minutes later.

    I changed the target address to another account I had and found my e-mails in the spam folder. Apparently the previous target account wasn't going to let me know I was getting junk mail.

    Anyway, I found the To: From: and Subject: all on the same line, so putting newline characters (\n) at the end of each datasend call fixed the problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://948978]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-04-17 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls