maillib reference manual


Mail::Session

Super Class

Object

Class Methods

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

This method Create a new Session object. 'Session' is abstract class.

start( address = 'localhost', port = nil, *args )
start( address = 'localhost', port = nil, *args ){|session| .... }

This method create a new Session object and start session. If you call this method with block, Session object give itself to block and finish session when block returns.

Methods

start( address = 'localhost', port = nil, *args )

This method start session. If you call this method when the session is already started, this only returns false without doing anything.

'port' and '*args' are specified in subclasses.

finish

This method finish session. If you call this method before session starts, it only return false without doing anything.

active?

true if session have been started

Constants

Version

The version of Session class. It is a string like "1.0.3".


Mail::Protocol

Super Class

Object

Class Methods

new( socket )

This method create new Protocol object. 'socket' must be ProtocolSocket. This method is abstract class.

Methods

quit

This method finishes protocol.


Mail::ProtocolSocket

Super Class

Object

Class Methods

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

This create new ProtocolSocket object, and connect to server.

Methods

close

This method closes socket.

addr: String

a FQDN address of server

ipaddr: String

an IP address of server

port: Integer

connecting port number.

closed?

true if ProtocolSokcet have been closed already

write( src ): Integer

This method send 'src'. ProtocolSocket read strings from 'src' by 'each' iterator. This method returns written bytes.

writebin( src ): Integer

This method send 'src'. ProtocolSokcet read string from 'src' by 'each' iterator. This method returns written bytes.

writeline( str: String ): Integer

This method writes 'str'. There has not to be bare "\r" or "\n" in 'str'.

write_pendstr( src ): Integer

This method writes 'src' as a mail. ProtocolSocket reads strings from 'src' by 'each' iterator.

read( len: Integer ): String

This method read 'len' bytes and return the string.

readuntil( target: String ): String

This method read until find 'target'. Returns read string.

readline: String

read until "\r\n" and returns it without "\r\n".

read_pendstr: String

This method read until "\r\n.\r\n". At the same time, delete period at line head and final line ("\r\n.\r\n").

read_pendlist: Array of String
read_pendlist{|line| .... }

This method read until "\r\n.\r\n". This method resembles to 'read_pendstr', but 'read_pendlist' don't check period at line head, and returns array which each element is one line.

When this method was called with block, evaluate it for each reading a line.


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