NAME

Connection::SMTP - Zero Knowledge Simple Mail Transport Protocol


SYNOPSIS

    use Connection::NNTP;

    $nntp = new Connection::SMTP();
    $nntp = new Connection::SMTP( User => $user );


REQUIRES

    Perl5.004+
    Net::SMTP
    User::Base (Subclass)


EXPORTS

Nothing


DESCRIPTION

This is the SMTP protocol encapsulation class. This class implements a client interface to the SMTP protocol enabling perl applications to talk to SMTP servers. This implementation assumes that you are familiar with the concepts of the SMTP protocol described in RFC821.

The Connection::SMTP object must be created with the new method. Once this has been done, all SMTP commands are accessed through this object.

The Connection::SMTP class is subclass of Connection::Base.


EXAMPLE

    #!/usr/bin/perl C<-w>

    use User::Net;
    use Message::MailMessage;
    use Connection::SMTP;

    $user = new User::Net();
    $message = new Message::MailMessage();

    $smtp = new Connection::SMTP();

    $smtp->connect( $user );
    $smtp->post( $message );
    $smtp->quit();


CONSTRUCTOR

new Connection::SMTP( [ USER ] )

This is the constructor for the Connection::SMTP object. USER is the user for authentication to the server. The USER parameter is one of the sub-classes of the User::Base hiearchy and is optional.

Constructor options must be passed in a hash-like fashion, using key and value pairs.

Example:

  $smtp = new Connection::SMTP( User => $server );


METHODS

connect( [ USER ] )

Open the connection to the remote SMTP server. If USER was not specified at object creaton then they must be provided for successful connection to the remote server. USER is one of the sub-classes of User::Base class hiearchy.

user ( USER )

Returns the user object associated with this SMTP server connection. If USER is supplied, then it wil be used for future connections, but will not affect the current news server connection.

send_msg( MESSAGE )

Send a message to the remote mail server. The MESSAGE parmaeter is an object of type Message::MailMessage.

quit()

Close the connection to remote SMTP server.


CLASS VARIABLES

None Present


SEE ALSO

Net::SMTP, Connection::Base, User::Net, User::Nym, Message::MailMessage


AUTHOR

Kris Smith <krissmi@zeroknowledge.com> Philippe McLean <phillipem@zeroknowledge.com>


COPYRIGHT

Copyright 2000 Zero Knowledge Systems, Inc. All rights reserved