| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
# Install package from JSR.
deno add jsr:@neabyte/deno-mailer// Import package entry.
import mailer from '@neabyte/deno-mailer'
// Create SMTP transporter instance.
const transporter = mailer.transporter({
host: 'smtp.domain.com',
port: 587,
secure: false,
auth: {
type: 'password',
user: 'user@domain.com',
pass: 'password'
}
})
// Send one email with text and HTML parts.
const result = await transporter.send({
from: '"John Doe" <john.doe@example.com>',
to: 'recipient@domain.com',
subject: 'Test Email',
text: 'This is a test email',
html: '<b>This is a test email</b>'
})
console.log(result.messageId)# Run format, lint, and type-check.
deno task check# Copy env template for SMTP integration tests.
cp .env.example .env# Set ETHEREAL_USER and ETHEREAL_PASS in .env, then run test suite.
deno task test# Alternative: export credentials in shell, then run test suite.
export ETHEREAL_USER=your-ethereal-username
export ETHEREAL_PASS=your-ethereal-password
# Optional: run OAuth2 integration test too.
export SMTP_OAUTH2_ACCESS_TOKEN=your-oauth2-access-token
export RUN_OAUTH2_SMTP_TEST=true
# Optional: run secure TLS (port 465) integration test too.
export RUN_SECURE_SMTP_TEST=true
# Run full unit and integration tests.
deno task testContributions are welcome. Open an issue or submit a pull request.
This project is licensed under the MIT license. See LICENSE.
| Back | FazBrowse Home | New Git URL |