Mail SMTP sender object

# new TubMailSenderBind (paramsObjObject)

Arguments:
  • paramsObj: Object
    • hostString

      mail server host

    • portString

      mail server port

    • user=''String

      mail server login

    • password=''String

      mail server password

    • tlsBoolean

      use tls on server request. OpenSSL libraries version >= 0.9.7 must be installed - see package README.md for details

    • fullSSLBoolean

      Setup TLS before any command to SMTP

    • authBoolean

      authentication required

    • deferLoginBoolean

      do not call an SMTP Login method inside a constructor (MUST be called manually)

    parameters object

Methods

# login () static

Login to mail server (if deferLogin === true in a constructor) throws on any error

# sendMail (mailObjObject) → Boolean static

send a email message

Return:

True if successfully

Arguments:
  • mailObj: Object
    • subjectString

      mail subject

    • bodyType=UBMail.TubSendMailBodyType.TextUBMail.TubSendMailBodyType

      mail body type

    • body=''String

      mail body. If bodyType is Calendar then valid *.ics file

    • fromAddr=''String

      sender address

    • replyTo=''String

      the Reply-To address in email

    • toAddr=[]Array.<String>

      array of receivers addresses

    • attaches=[]Array.<UBMail.TubMailAttach>

      array of attaches. Ignored when bodyType is Calendar.

    sending mail object