Skip to main content

类: Client

smtp.Client Client 是用于 nuclei 脚本的最小化 SMTP 客户端。 示例
const smtp = require('nuclei/smtp');
const client = new smtp.Client('acme.com', 25);

目录

构造函数

属性

方法

构造函数

constructor

new Client(host, port): Client

参数

名称类型
hoststring
portstring

返回

Client

定义于

smtp.ts:15

属性

host

host: string

定义于

smtp.ts:15

port

port: string

定义于

smtp.ts:15

方法

IsOpenRelay

IsOpenRelay(msg): boolean IsOpenRelay 检查主机是否为开放中继。

参数

名称类型
msgSMTPMessage

返回

boolean 示例
const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('[email protected]');
message.To('[email protected]');
message.Subject('hello');
message.Body('hello');
const client = new smtp.Client('acme.com', 25);
const isRelay = client.IsOpenRelay(message);

定义于

smtp.ts:47

IsSMTP

IsSMTP(): SMTPResponse IsSMTP 检查主机是否运行 SMTP 服务器。

返回

SMTPResponse 示例
const smtp = require('nuclei/smtp');
const client = new smtp.Client('acme.com', 25);
const isSMTP = client.IsSMTP();
log(isSMTP)

定义于

smtp.ts:28

SendMail

SendMail(msg): boolean SendMail 使用 SMTP 协议发送电子邮件。

参数

名称类型
msgSMTPMessage

返回

boolean 示例
const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('[email protected]');
message.To('[email protected]');
message.Subject('hello');
message.Body('hello');
const client = new smtp.Client('acme.com', 25);
const isSent = client.SendMail(message);
log(isSent)

定义于

smtp.ts:67