Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Perl Programming Language

using a remote smarthost to send mail from a perl script


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?

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.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc