NAME

Net::SMTP::OneLiner - extension that polutes the local namespace with a send_mail() function.

A brief example

use Net::SMTP::OneLiner;

my $from = 'me@mydomain.tld';
my $to   = [qw(some@targ.tld one@targ.tld)];
my $cc   = [qw(some@targ.tld one@targ.tld)];
my $bcc  = [qw(some@targ.tld one@targ.tld)];
my $subj = "The Subject";
my $msg  = "The Message";
my $labl = { 'me@mydomain.tld' => "My RealName", 'one@targ.tld' => "Their realname" };

 
# Examples:

send_mail($from, $to, $subj, $msg);
send_mail($from, $to, $subj, $msg, $cc);
send_mail($from, $to, $subj, $msg, undef, $bcc);
send_mail($from, $to, $subj, $msg, $cc, $bcc, $labl);
send_mail($from, $to, $subj, $msg, undef, undef, $labl);

send_mail('me@domain', ['you@domain'], "heyya there", "supz!?!?");

# The simplest way:

send_mail('me@domain', 'you@domain', "heyya there", "supz!?!?");

# $to will take a scalar argument, $cc and $bcc will not.
# At this time, the mail server, must be the localhost.

VARS

Hirosi Taguti requested a method for changing the SMTP host. I provided that and a few other variables. The values listed are the defaults.

$Net::SMTP::OneLiner::HOSTNAME = "localhost"

The hostname of the SMTP server you wish to use.

$Net::SMTP::OneLiner::EHLO = "localhost"

The hostname you wish to send in the EHLO greeting. It normally doesn't matter what you put here -- even if you change the HOSTNAME.

$Net::SMTP::OneLiner::DEBUG = 0

If this is set to true, OneLiner will tell Net::SMTP to spew forth many lines of debugging info.

$Net::SMTP::OneLiner::TIMEO = 20

Use this to change the communication timeout (in seconds) with the SMTP host.

Your

Bugs

Please report bugs immediately! The author has not tested this module worth a lick -- expecting it to work just fine. If this is not the case, he would like to know, so he can fix it.

Author

Jettero Heller jettero@cpan.org

COPYRIGHT

GPL!  I included a gpl.txt for your reading enjoyment.

Though, additionally, I will say that I'll be tickled if you were to
include this package in any commercial endeavor.  Also, any thoughts to
the effect that using this module will somehow make your commercial
package GPL should be washed away.

I hereby release you from any such silly conditions.

This package and any modifications you make to it must remain GPL.  Any
programs you (or your company) write shall remain yours (and under
whatever copyright you choose) even if you use this package's intended
and/or exported interfaces in them.