Mdc::Mail


Mdc::Mail


Description

 Mdc::Mail.pm - v1.00 Oct 26, 2004

This module povides an easy interface to the Net::SMTP module for sending email messages.


Synopsis

 use Mdc::Mail;

 my $MAIL = new Mdc::Mail(      server   => 'mailhost',
                                sender   => 'me@mydomain' );

 $MAIL->Send(                   to=> 'you@yourdomain',
                                subject  => 'Test message',
                                content  => 'Test message'  );


Methods

new

 my $MAIL = new Mdc::Mail(      server => 'mailhost',
                                sender => 'me@mydomain',
                                xmailer=> 'My Program v1.0',
                                debug  => 0,
                                timeout=> 15 );

Create new object reference. Arguments are to be supplied as HASH items.

server
Specifies the name of the SMTP server for outgoing mail.

sender
Specifies the sender's address.

debug (optional)
Enable debug mode if true. Messages will be sent to STDERROR. Default is false.

timeout (optional)
Specifies the timeout period to wait for a connection to the SMTP server. Default is 15 seconds.

xmailer (optional)
The name and version of your program.

Send

 $ok = $MAIL->Send(     to      => 'you@yourdomain',
                        cc      => 'him@hisdomain',
                        bcc     => 'her@herdomain',
                        replyto => 'me@mydomain',
                        subject => 'Test message',
                        content => 'Test message'  );

Send a message to the specifed recipient. Return TRUE if successful. A comma separated list may be used for multiple recipients in the to, cc, or bcc fields.

to
Address of the intended recipient.

cc
Send copy to this address.

bcc
Send blind copy to this address.

replyto
Replies will be sent to this address.

subject (optional)
Subject line of the outgoing message.

content
The message body being mailed. A scalar reference is acceptable.


Error Codes

                1601    Parameter not defined
                1602    SMTP server not found
                1603    Sender's address not accepted
                1604    Recipient's address not accepted
                1605    Message not sent


Author and Copyright

 Mdc::Mail Copyright (c) 2004 Mark K Mueller. All rights reserved.
 Mark K Mueller
 PO Box 576705
 Modesto, CA 95357
 http://www.markmueller.com/

MkM 26Oct2004