@modelence/smtp
v1.0.1
Published
SMTP Adapter fro Modelence
Downloads
11
Readme
@modelence/smtp
SMTP Adapter for Modelence
Installation
npm i @modelence/smtpOverview
This package provides sendEmail function that utilizes SMTP protocol under the hood. The configuration can be set via Modelence Cloud or the following environment variables:
- MODELENCE_EMAIL_SMTP_HOST
- MODELENCE_EMAIL_SMTP_PORT
- MODELENCE_EMAIL_SMTP_USER
- MODELENCE_EMAIL_SMTP_PASS
Simple usage
import { sendEmail } from '@modelence/smtp';
sendEmail({
to: '[email protected]',
from: '[email protected]',
subject: 'Test Email',
html: '<h1>Test Email</h1>',
})Advanced example
import { sendEmail } from '@modelence/smtp';
sendEmail({
to: '[email protected]',
from: '[email protected]',
subject: 'Test Email',
html: '<h1>Test Email</h1>',
cc: '[email protected]',
bcc: '[email protected]',
attachments: [
{
name: "file.svg",
content: "data:image/svg+xml;base64,...",
contentType: "image/svg+xml"
},
]
});