By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,078 Members | 2,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,078 IT Pros & Developers. It's quick & easy.

net::smtp

P: n/a
I'm having some problems with a little script i wrote using net::smtp.
I originally wrote it in linux where it works perfectly. I tried to
use it from windows the other day and it doesn't work. It connects to
the server and prints the banner but will not send mail.
Here is my script:

use Net::SMTP;

my $smtp = Net::SMTP->new('smtp.comcast.net') or die "Can't Open
server"!";
print $smtp->banner, "\n";

$smtp->mail('m***@comcast.net');
$smtp->to('m***@comcast.net');

$smtp->data();
$smtp->datasend("To: ma**@comcast.net\n");
$smtp->datasend("From: somedude\n");
$smtp->datasend("Subject: dude\n");
$smtp->datasend("Reply-To: ma**@comcast.net\n");
$smtp->datasend("\n");
$smtp->datasend("test test");
$smtp->dataend();

$smtp->quit;

thanks :)
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 27 Jul 2004 22:07:21 GMT, RandRace <de*********@hotmail.com>
wrote:
I'm having some problems with a little script i wrote using net::smtp.
I originally wrote it in linux where it works perfectly. I tried to
use it from windows the other day and it doesn't work. It connects to
the server and prints the banner but will not send mail.
Here is my script:

use Net::SMTP;

my $smtp = Net::SMTP->new('smtp.comcast.net') or die "Can't Open
server"!";
print $smtp->banner, "\n";

$smtp->mail('m***@comcast.net');
$smtp->to('m***@comcast.net');

$smtp->data();
$smtp->datasend("To: ma**@comcast.net\n");
$smtp->datasend("From: somedude\n");
$smtp->datasend("Subject: dude\n");
$smtp->datasend("Reply-To: ma**@comcast.net\n");
$smtp->datasend("\n");
$smtp->datasend("test test");
$smtp->dataend();

$smtp->quit;

thanks :)


To follow up, i put "or die" after every line and the program seems to
be failing at the dataend portion. Ive been messing around with it all
day and cant seem to figure out what the problem is. Any help is
appreciated. :)
Jul 19 '05 #2

P: n/a
RandRace <de*********@hotmail.com> wrote in message news:<pa****************************@hotmail.com>. ..
I'm having some problems with a little script i wrote using net::smtp.


Have you considered putting Net::SMTP into debug mode so you can see
what it's doing? If you didn't know you could do that then perhaps
you are forgetting that when reading the documentation of a subclass
it is also necessary to consult the documentation of the parent
classes to find out its full set of features.

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.