maillib reference manual


Mail::SMTPSession

Super Class

Mail::Session

Class Methods

new( address = 'localhost', port = 25 )

This method create new SMTPSession object.

Methods

start( helo_domain = ENV['HOSTNAME'] )

This method opens TCP connection and start SMTP session. If session had been started, do nothing and return false.

sendmail( mailsrc, from_domain, to_addrs )

This method sends 'mailsrc' as mail. SMTPSession read strings from 'mailsrc' by calling 'each' iterator, and convert them into "\r\n" terminated string when write.

SMTPSession's Exceptions are:

finish

This method closes SMTP session. If session had not started, do nothind and return false.


Mail::SMTP

Super Class

Mail::Protocol

Class Methods

new( socket: ProtocolSocket )
This method creates new SMTP object, and open SMTP session.

Methods

helo( helo_domain )

This method send "HELO" command and start SMTP session.
helo_domain is localhost's FQDN.

mailfrom( from_addr )

This method sends "MAIL FROM" command.
from_addr is your mail address(????@????).

rcpt( to_addrs )

This method sends "RCPT TO" command.
to_addrs is array of mail address(???@???) of destination.

data( mailsrc )

This method send 'mailsrc' as mail. SMTP reads strings from 'mailsrc' by calling 'each' iterator.

quit

This method sends "QUIT" command and ends SMTP session.


author: Minero Aoki (aamine@dp.u-netsurf.ne.jp)