Skip to main content

smtp.smtp

Home > @runlightyear/smtp > Smtp

Smtp class

Generic SMTP Connector

Signature:
declare class Smtp extends SmtpConnector 

Extends:

SmtpConnector

Example 1

Import

import { Smtp } from "@runlightyear/smtp";

Example 2

Use in an action

defineAction({
name: "smtpExample",
title: "SMTP Example"
apps: ["smtp"],
run: async ({ auths }) => {
const smtp = new Smtp({ auth: auths.smtp });
}
}

Example 3

Send an email

await smtp.sendMail({
from: "<your email address>",
to: "<your to line>"
subject: "<your subject>",
text: "<your plaintext email body>",
html: "<your html email body>",
})

Constructors

ConstructorModifiersDescription
(constructor)(props)Constructs a new instance of the Smtp class