Class SMTPTransport

Class Summary
Constructor Attributes Constructor Name and Description
 
SMTPTransport(options)

Generates a Transport object for SMTP

NB! This is a pool of connections that try to keep themselves alive.

Method Summary

Class Detail

SMTPTransport(options)

Generates a Transport object for SMTP

NB! This is a pool of connections that try to keep themselves alive. The connection is not closed to the server once the message is delivered.

Possible options can be the following:

  • service - a well known service identifier ("Gmail", "Hotmail" etc.) for auto-completing host, port and secure connection settings
  • host - hostname of the SMTP server
  • port - port of the SMTP server
  • secureConnection - use SSL
  • name - the name of the client server
  • auth - authentication object as {user:"...", pass:"..."}
  • ignoreTLS - ignore server support for STARTTLS
  • debug - output client and server messages to console
  • maxConnections - how many connections to keep in the pool
Parameters:
{Object} options Optional
SMTP options

Method Detail

  • close(callback)

    Closes the client pool

    Parameters:
    {Function} callback
    Callback function to run once the pool is closed
  • initOptions()

    Initializes the SMTP connection options. Needed mostly for legacy option values and also for filling in the well known hosts data if needed.

  • sendMail(emailMessage, callback)

    Forwards the mailcomposer message object to the simplesmpt client pool

    Parameters:
    {Object} emailMessage
    MailComposer object
    {Function} callback
    Callback function to run when the sending is completed