473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

net::smtp

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
2 13680
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Almir | last post by:
I hate this Net::SMTP stuff, everything works fine but for the suject field. I see no way of having it show in an email when sent. Has anyone had this problem, can anyone explain why there are no...
0
by: peterson | last post by:
I was trying to send asp.net-smtp mail of UTF-8 unicode international character contents. When I opened the mailbox contents was broken. I am using html format too. Am I missing something?
1
by: neog | last post by:
I'm having a problem with Net::Smtp. Does the datasend() method have problems sending strings containing single quotes? Like I stored the string "Germany's biggest bank, hired" in a hash and it...
11
by: ibiza | last post by:
Hi all, I am trying to use the System.Net.Mail class for the first time, with ASP.NET 2.0. I setup everything according to http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives...
4
by: patrickinminneapolis | last post by:
Hi guys, I'm trying to write an emailer, but I can't manage to construct the object properly. Here's what I've got: #!/usr/local/bin/perl -w use Net::SMTP; $smtp =...
13
by: jcor | last post by:
Hi, I'm trying some code to send a mail with my script. This is it: #!/usr/bin/perl use Net::SMTP; my $smtp_server='62.193.245.15'; my $smtp = Net::SMTP->new($smtp_server) or die "Can't Open...
5
by: jimhill10 | last post by:
I have a perl script that creates an email attachment file from POST data on a web page. This works just fine. I want to customize the email body to contain all of the text data from the file...
1
by: wootmaster | last post by:
I'm writing a script that will run a few tests on a given mail server, it's meant to test to see if VRFY and EXPN is enabled or not. However, when I use "verify" to test to see if VRFY is enabled on...
5
by: veralee | last post by:
I'm in dire need to use Net::SMTP. The server no longer uses "sendmail". I found an example of using Net::SMTP but I have to also include a user name and password for the server. The host provided...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.