pskiz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -wT use Net::SMTP; print "Content-type: text/plain", "\n\n"; my $DEBUG = 1; if ($DEBUG) { $| = 1; open(STDERR, ">&STDOUT"); } # smtp server name my $serverName = "mail.blah.com"; # create a new smtp object $smtp = Net::SMTP->new($serverName, Debug => 1); # if you can't connect then dont proceed with the rest of the script die "Couldn't connect to server" unless $smtp; # initiate the mail transaction # your "real" email address my $from = "crap\@blah.com"; # recipient's "real" email address my $to = "poop\@toilet.com"; $smtp->mail($from); $smtp->to($to); # start the mail $smtp->data(); # send the header # this address will appear in the message $smtp->datasend("To: poop\@toilet.com\n"); # so will this one $smtp->datasend("From: crap\@blah.com\n"); $smtp->datasend("Subject: Online Ordering Test Message\n"); $smtp->datasend("\n"); # send the body $smtp->datasend("TESTING TESTING TESTING\n\n"); # send the termination string $smtp->dataend(); # close the connection $smtp->quit();
Relaying denied. IP name possibly forged
i really dont know whats going on. if i send an email using this script to myself i dont get that error, but i also dont get the mail.
i also get these errors:Net::SMTP=GLOB(0x8114994)<<< 500 5.5.1 Command unrecognized: "To: poop +@toilet.com" Net::SMTP=GLOB(0x8114994)>>> QUIT Net::SMTP=GLOB(0x8114994)<<< 500 5.5.1 Command unrecognized: "From: cr +ap@blah.com"
any help is greatly appreciated
Janitored by Arunbear - added readmore tags, as per Monastery guidelines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SMTP problem
by mattriff (Chaplain) on Nov 01, 2004 at 16:59 UTC | |
|
Re: SMTP problem
by demerphq (Chancellor) on Nov 01, 2004 at 17:50 UTC | |
by nimdokk (Vicar) on Nov 01, 2004 at 18:39 UTC | |
|
Re: SMTP problem
by TedPride (Priest) on Nov 01, 2004 at 20:48 UTC | |
|
Re: SMTP problem
by cosmicperl (Chaplain) on Nov 01, 2004 at 21:15 UTC |