using a remote smarthost to send mail from a perl script

Discussion in 'Perl Misc' started by Bennett, Jun 1, 2007.

  1. Bennett

    Bennett Guest

    I have a perl script on a low-powered machine and I want to send mail
    from the machine by relaying the outgoing mail through a remote SMTP
    server (that I've paid for, of course, not an open relay :) ).

    I've tried searching for things like "perl" "use a smarthost" but I've
    been unable to find anything relevant. Are there any code samples
    showing how to do this?
     
    Bennett, Jun 1, 2007
    #1
    1. Advertising

  2. Bennett

    Adam Funk Guest

    On 2007-06-01, Bennett wrote:

    > I have a perl script on a low-powered machine and I want to send mail
    > from the machine by relaying the outgoing mail through a remote SMTP
    > server (that I've paid for, of course, not an open relay :) ).
    >
    > I've tried searching for things like "perl" "use a smarthost" but I've
    > been unable to find anything relevant. Are there any code samples
    > showing how to do this?


    If your requirements are simple, you can probably use the Mail::Mailer
    module. According to the man page, you can

    Use the "smtp" protocol via Net::SMTP to deliver the mail. The
    server to use can be specified in @args with

    $mailer = new Mail::Mailer smtp, Server => $server;

    The smtp mailer does not handle "Cc" and "Bcc" lines, neither their
    "Resent-*" fellows. The "Debug" options enables debugging output
    from "Net::SMTP".

    You may also use the "Auth => [ $user, $password ]" option for SASL
    authentication (requires Authen::SASL and MIME::Base64).

    HTH.
     
    Adam Funk, Jun 1, 2007
    #2
    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. dpackwood
    Replies:
    3
    Views:
    1,811
  2. =?Utf-8?B?Unlhbg==?=
    Replies:
    2
    Views:
    3,910
    Steven Cheng[MSFT]
    Feb 28, 2006
  3. Ramon
    Replies:
    2
    Views:
    1,016
    Ramon
    Oct 25, 2007
  4. radgey gadgey hl
    Replies:
    0
    Views:
    716
    radgey gadgey hl
    Nov 25, 2007
  5. Dune

    CDOSYS and smarthost

    Dune, Jan 8, 2004, in forum: ASP General
    Replies:
    2
    Views:
    144
Loading...

Share This Page