Connection::SMTP - Zero Knowledge Simple Mail Transport Protocol
use Connection::NNTP;
$nntp = new Connection::SMTP(); $nntp = new Connection::SMTP( User => $user );
Perl5.004+ Net::SMTP User::Base (Subclass)
Nothing
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.
#!/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();
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 );
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.
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 a message to the remote mail server. The MESSAGE parmaeter is an object of type Message::MailMessage.
Close the connection to remote SMTP server.
None Present
Net::SMTP, Connection::Base, User::Net, User::Nym, Message::MailMessage
Kris Smith <krissmi@zeroknowledge.com> Philippe McLean <phillipem@zeroknowledge.com>
Copyright 2000 Zero Knowledge Systems, Inc. All rights reserved