Smtp.SMTPClient
Class: SMTPClient
smtp.SMTPClient
SMTPClient is a minimal SMTP client for nuclei scripts.
Example
const smtp = require('nuclei/smtp');
const client = new smtp.Client();
Table of contents
Constructors
Methods
Constructors
constructor
• new SMTPClient(): SMTPClient
Returns
Defined in
smtp.ts:15
Methods
IsOpenRelay
▸ IsOpenRelay(host
, port
, msg
): boolean
IsOpenRelay checks if a host is an open relay.
Parameters
Name | Type |
---|---|
host | string |
port | number |
msg | SMTPMessage |
Returns
boolean
Example
const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('xyz@projectdiscovery.io');
message.To('xyz2@projectdiscoveyr.io');
message.Subject('hello');
message.Body('hello');
const isRelay = smtp.IsOpenRelay('acme.com', 25, message);
Defined in
smtp.ts:43
IsSMTP
▸ IsSMTP(host
, port
): IsSMTPResponse
IsSMTP checks if a host is running a SMTP server.
Parameters
Name | Type |
---|---|
host | string |
port | number |
Returns
Example
const smtp = require('nuclei/smtp');
const isSMTP = smtp.IsSMTP('acme.com', 25);
log(toJSON(isSMTP));
Defined in
smtp.ts:25
SendMail
▸ SendMail(host
, port
, msg
): boolean
SendMail sends an email using the SMTP protocol.
Parameters
Name | Type |
---|---|
host | string |
port | string |
msg | SMTPMessage |
Returns
boolean
Example
const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('xyz@projectdiscovery.io');
message.To('xyz2@projectdiscoveyr.io');
message.Subject('hello');
message.Body('hello');
const isSent = smtp.SendMail('acme.com', 25, message);
Defined in
smtp.ts:61
Was this page helpful?