Class: SMTPMessage

smtp.SMTPMessage

SMTPMessage is a message to be sent over SMTP

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('xyz@projectdiscovery.io');

Table of contents

Constructors

Methods

Constructors

constructor

new SMTPMessage(): SMTPMessage

Returns

SMTPMessage

Defined in

smtp.ts:83

Methods

Auth

Auth(username): SMTPMessage

Auth when called authenticates using username and password before sending the message

Parameters

NameType
usernamestring

Returns

SMTPMessage

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.Auth('username', 'password');

Defined in

smtp.ts:149


Body

Body(msg): SMTPMessage

Body adds the message body to the message

Parameters

NameType
msgUint8Array

Returns

SMTPMessage

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.Body('hello');

Defined in

smtp.ts:135


From

From(email): SMTPMessage

From adds the from field to the message

Parameters

NameType
emailstring

Returns

SMTPMessage

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.From('xyz@projectdiscovery.io');

Defined in

smtp.ts:93


String

String(): string

String returns the string representation of the message

Returns

string

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');
log(message.String());

Defined in

smtp.ts:167


Subject

Subject(sub): SMTPMessage

Subject adds the subject field to the message

Parameters

NameType
substring

Returns

SMTPMessage

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.Subject('hello');

Defined in

smtp.ts:121


To

To(email): SMTPMessage

To adds the to field to the message

Parameters

NameType
emailstring

Returns

SMTPMessage

Example

const smtp = require('nuclei/smtp');
const message = new smtp.SMTPMessage();
message.To('xyz@projectdiscovery.io');

Defined in

smtp.ts:107