net::smtp

Discussion in 'Perl' started by RandRace, Jul 27, 2004.

  1. RandRace

    RandRace Guest

    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('');
    $smtp->to('');

    $smtp->data();
    $smtp->datasend("To: \n");
    $smtp->datasend("From: somedude\n");
    $smtp->datasend("Subject: dude\n");
    $smtp->datasend("Reply-To: \n");
    $smtp->datasend("\n");
    $smtp->datasend("test test");
    $smtp->dataend();

    $smtp->quit;

    thanks :)
     
    RandRace, Jul 27, 2004
    #1
    1. Advertisements

  2. On Tue, 27 Jul 2004 22:07:21 GMT, RandRace <>
    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('');
    >$smtp->to('');
    >
    >$smtp->data();
    >$smtp->datasend("To: \n");
    >$smtp->datasend("From: somedude\n");
    >$smtp->datasend("Subject: dude\n");
    >$smtp->datasend("Reply-To: \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. :)
     
    henry farbles, Jul 28, 2004
    #2
    1. Advertisements

  3. RandRace

    Guest

    RandRace <> wrote in message news:<>...

    > 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 29, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Almir
    Replies:
    0
    Views:
    875
    Almir
    Dec 10, 2003
  2. bivin
    Replies:
    1
    Views:
    884
    venkat
    Jun 27, 2003
  3. Robert Hanson

    Help Needed with SMTP mail in ASP.Net

    Robert Hanson, Jul 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    Robert Hanson
    Jul 23, 2003
  4. Robert Hanson

    Re: Help Needed with SMTP mail in ASP.Net

    Robert Hanson, Jul 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    404
    Yan-Hong Huang[MSFT]
    Jul 25, 2003
  5. Replies:
    3
    Views:
    1,341
    Roedy Green
    Jan 24, 2006
  6. Alex Hunsley
    Replies:
    4
    Views:
    4,537
    Tim Williams (gmail)
    Jun 29, 2004
  7. Copelandia Cyanescens

    smtplib.SMTP "no attributes SMTP"

    Copelandia Cyanescens, Jul 31, 2004, in forum: Python
    Replies:
    2
    Views:
    2,149
    Copelandia Cyanescens
    Jul 31, 2004
  8. tshad
    Replies:
    1
    Views:
    1,089
    bruce barker
    May 5, 2008
Loading...