Net::SMTP

Discussion in 'Perl Misc' started by Erik Waibel, Aug 1, 2003.

  1. Erik Waibel

    Erik Waibel Guest

    Hello,

    I'm trying to send mail using the Net::SMTP module, but am having
    difficulties. I'm not using Perl, I'm using "ccperl", which comes with
    ClearCase. So I'm limited to the mail modules that came standard with the
    installation: Mail::Mailer, Mail::Mailer::sendmail, Net::SMTP... Here's my
    code:

    use Net::SMTP;
    sub send_mail
    {
    $send_to = '';
    $server = 'my_server.com';
    $smtp = new Net::SMTP ('host', Hello=>$server);

    $smtp->mail($ENV{USER});
    $smtp->to($send_to);

    $smtp->data();
    $smtp->datasend("To: whomever");
    $smtp->datasend("\n");
    $smtp->datasend("Test");
    $smtp->dataend();

    $smtp->quit;
    }

    This is the error:

    %cmd> ccperl cclibrpt.pl
    "connect: The requested address is not valid in its context.
    at cclibrpt.pl line 149"

    The line being referred to is the $smtp = new... line
    -- -------
    Thanks,
    Erik Waibel
    ----------
    Perl Hacker v.1.0
     
    Erik Waibel, Aug 1, 2003
    #1
    1. Advertising

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. Replies:
    3
    Views:
    1,118
    Roedy Green
    Jan 24, 2006
  2. Alex Hunsley
    Replies:
    4
    Views:
    3,638
    Tim Williams (gmail)
    Jun 29, 2004
  3. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    903
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  4. Copelandia Cyanescens

    smtplib.SMTP "no attributes SMTP"

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

Share This Page