Skip to main content

smtp

(smtp).SMTPClient

SMTPClient is a minimal SMTP client for nuclei scripts. Kind: inner class of smtp

smtpClient.IsOpenRelay(host, port, msg) ⇒ boolean

IsOpenRelay checks if a host is an open relay Kind: instance method of SMTPClient
Returns: boolean - - Whether the host is an open relay or not.
Throws:
  • error - The error encountered during the check.
Example

smtpClient.IsSMTP(host, port) ⇒ IsSMTPResponse

IsSMTP checks if a host is running a SMTP server. Kind: instance method of SMTPClient
Returns: IsSMTPResponse - - The response from the SMTP server.
Throws:
  • error - The error encountered during the check.
Example

smtpClient.SendMail(host, port, msg) ⇒ boolean

SendMail sends an email using the SMTP protocol. Kind: instance method of SMTPClient
Returns: boolean - - Whether the email was sent successfully or not.
Throws:
  • error - The error encountered during the email sending.
Example

(smtp).SMTPMessage

SMTPMessage is a simple smtp message builder Kind: inner class of smtp

smtpMessage.Auth(username, password) ⇒ SMTPMessage

Auth when called authenticates using username and password before sending the message Kind: instance method of SMTPMessage
Returns: SMTPMessage - - The SMTPMessage object after authentication.
Example

smtpMessage.Body(msg) ⇒ SMTPMessage

Body adds the message body to the message Kind: instance method of SMTPMessage
Returns: SMTPMessage - - The SMTPMessage object after adding the body.
Example

smtpMessage.From(email) ⇒ SMTPMessage

From adds the from field to the message Kind: instance method of SMTPMessage
Returns: SMTPMessage - - The SMTPMessage object after adding the from field.
Example

smtpMessage.String() ⇒ string

String returns the string representation of the message Kind: instance method of SMTPMessage
Returns: string - - The string representation of the message.
Example

smtpMessage.Subject(sub) ⇒ SMTPMessage

Subject adds the subject field to the message Kind: instance method of SMTPMessage
Returns: SMTPMessage - - The SMTPMessage object after adding the subject.
Example

smtpMessage.To(email) ⇒ SMTPMessage

To adds the to field to the message Kind: instance method of SMTPMessage
Returns: SMTPMessage - - The SMTPMessage object after adding the to field.
Example