docster has asked for the wisdom of the Perl Monks concerning the following question:
sub mailThis { $mailServer = "serverName"; $ourEmail = 'ourEmail'; $theirEmail = 'theirEmail'; $subject = "Test Email"; $body = "Welcome $username"; eval { $mailer = new Mail::Mailer 'smtp', Server => $mailServer; $mailer->open ( { From => $ourEmail, To => $theirEmail, Subject => $subject, } ); print $mailer $body; $mailer->close(); }; if ($@) { # sending mail failed } else { # mail was sent } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::Mailer in a sub question.
by tirwhan (Abbot) on Feb 09, 2006 at 16:44 UTC | |
by docster (Novice) on Feb 09, 2006 at 17:43 UTC | |
by Fletch (Bishop) on Feb 09, 2006 at 17:53 UTC | |
by docster (Novice) on Feb 09, 2006 at 18:03 UTC | |
by tirwhan (Abbot) on Feb 09, 2006 at 18:44 UTC | |
by docster (Novice) on Feb 09, 2006 at 19:05 UTC | |
by tirwhan (Abbot) on Feb 09, 2006 at 19:41 UTC | |
|