213 lines
5.2 KiB
HTML
213 lines
5.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Mail::Send</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Mail::Send</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-07-25<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Mail::Send - Simple electronic mail interface
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
require Mail::Send;
|
|
|
|
$msg = Mail::Send->new;
|
|
$msg = Mail::Send->new(Subject => 'example', To => 'timbo');
|
|
|
|
$msg->to('<A HREF="mailto:user@host">user@host</A>');
|
|
$msg->to('<A HREF="mailto:user@host">user@host</A>', '<A HREF="mailto:user2@example.com">user2@example.com</A>');
|
|
$msg->subject('example subject');
|
|
$msg->cc('<A HREF="mailto:user@host">user@host</A>');
|
|
$msg->bcc('<A HREF="mailto:someone@else">someone@else</A>');
|
|
|
|
$msg->set($header, @values);
|
|
$msg->add($header, @values);
|
|
$msg->delete($header);
|
|
|
|
# Launch mailer and set headers. The filehandle returned
|
|
# by open() is an instance of the Mail::Mailer class.
|
|
# Arguments to the open() method are passed to the Mail::Mailer
|
|
# constructor.
|
|
|
|
$fh = $msg->open; # some default mailer
|
|
$fh = $msg->open('sendmail'); # explicit
|
|
print $fh "Body of message";
|
|
$fh->close # complete the message and send it
|
|
or die "couldn't send whole message: $!\n";
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
Mail::Send creates e-mail messages without using the Mail::Header
|
|
knowledge, which means that all escaping and folding must be done by
|
|
you! Also: do not forget to escape leading dots. Simplicity has its price.
|
|
<P>
|
|
|
|
When you have time, take a look at Mail::Transport which is part of
|
|
the MailBox suite.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Constructors</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">Mail::Send-><B>new</B>(<FONT SIZE="-1">PAIRS</FONT>)<DD>
|
|
|
|
|
|
A list of header fields (provided as key-value <FONT SIZE="-1">PAIRS</FONT>) can be used to
|
|
initialize the object, limited to the few provided as method: <TT>"to"</TT>,
|
|
<TT>"subject"</TT>, <TT>"cc"</TT>, and <TT>"bcc"</TT>. For other header fields, use <B>add()</B>.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Header fields</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2">$obj-><B>add</B>($fieldname, @values)<DD>
|
|
|
|
|
|
|
|
|
|
Add values to the list of defined values for the <TT>$fieldname</TT>.
|
|
<DT id="3">$obj-><B>bcc</B>(@values)<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="4">$obj-><B>cc</B>(@values)<DD>
|
|
|
|
|
|
|
|
|
|
<DT id="5">$obj-><B>delete</B>($fieldname)<DD>
|
|
|
|
|
|
|
|
|
|
<DT id="6">$obj-><B>set</B>($fieldname, @values)<DD>
|
|
|
|
|
|
|
|
|
|
|
|
The <TT>@values</TT> will replace the old values for the <TT>$fieldname</TT>. Returned is
|
|
the <FONT SIZE="-1">LIST</FONT> of values after modification.
|
|
<DT id="7">$obj-><B>subject</B>(@values)<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="8">$obj-><B>to</B>(@values)<DD>
|
|
|
|
|
|
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Sending</H3>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="9">$obj-><B>open</B>(%options)<DD>
|
|
|
|
|
|
|
|
|
|
The <TT>%options</TT> are used to initiate a mailer object via
|
|
<B>Mail::Mailer::new()</B>. Then <B>Mail::Mailer::open()</B> is called
|
|
with the knowledge collected in this <TT>"Mail::Send"</TT> object.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Be warned: this module implements raw smtp, which means that you have
|
|
to escape lines which start with a dot, by adding one in front.
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
This module is part of the MailTools distribution,
|
|
<I><A HREF="http://perl.overmeer.net/mailtools/">http://perl.overmeer.net/mailtools/</A></I>.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
|
|
|
|
The MailTools bundle was developed by Graham Barr. Later, Mark
|
|
Overmeer took over maintenance without commitment to further development.
|
|
<P>
|
|
|
|
Mail::Cap by Gisle Aas <<A HREF="mailto:aas@oslonett.no">aas@oslonett.no</A>>.
|
|
Mail::Field::AddrList by Peter Orbaek <<A HREF="mailto:poe@cit.dk">poe@cit.dk</A>>.
|
|
Mail::Mailer and Mail::Send by Tim Bunce <<A HREF="mailto:Tim.Bunce@ig.co.uk">Tim.Bunce@ig.co.uk</A>>.
|
|
For other contributors see ChangeLog.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>LICENSE</H2>
|
|
|
|
|
|
|
|
Copyrights 1995-2000 Graham Barr <<A HREF="mailto:gbarr@pobox.com">gbarr@pobox.com</A>> and
|
|
2001-2017 Mark Overmeer <<A HREF="mailto:perl@overmeer.net">perl@overmeer.net</A>>.
|
|
<P>
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
under the same terms as Perl itself.
|
|
See <I><A HREF="http://www.perl.com/perl/misc/Artistic.html">http://www.perl.com/perl/misc/Artistic.html</A></I>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="10"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="11"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="12"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="13"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DL>
|
|
<DT id="14"><A HREF="#lbAF">Constructors</A><DD>
|
|
<DT id="15"><A HREF="#lbAG">Header fields</A><DD>
|
|
<DT id="16"><A HREF="#lbAH">Sending</A><DD>
|
|
</DL>
|
|
<DT id="17"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="18"><A HREF="#lbAJ">AUTHORS</A><DD>
|
|
<DT id="19"><A HREF="#lbAK">LICENSE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:47 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|