A live, authenticated SMTP session that can send one or more messages.
Obtain one with connect. It is an AsyncDisposable, so it can be scoped with await using and will QUIT on disposal.
AsyncDisposable
await using
QUIT
1.0.0
import { connect } from 'edgeport/smtp';await using session = await connect({ hostname: 'smtp.example.com', auth: { username: 'me@example.com', password: process.env.SMTP_PASS! }});await session.send({ from: 'me@example.com', to: 'you@example.com', subject: 'Hi', text: 'Yo' }); Copy
import { connect } from 'edgeport/smtp';await using session = await connect({ hostname: 'smtp.example.com', auth: { username: 'me@example.com', password: process.env.SMTP_PASS! }});await session.send({ from: 'me@example.com', to: 'you@example.com', subject: 'Hi', text: 'Yo' });
Sends QUIT and closes the underlying socket.
Sends one message over the open session.
The message to send.
The accepted recipients and the server's final reply.
If the server rejects any envelope or data command.
A live, authenticated SMTP session that can send one or more messages.
Obtain one with connect. It is an
AsyncDisposable, so it can be scoped withawait usingand willQUITon disposal.Since
1.0.0
Example