Skip to content

Conversation

@productdevbook
Copy link
Owner

@productdevbook productdevbook commented Apr 6, 2025

SMTP Provider

import { createEmailService } from 'unemail'
import smtpProvider from 'unemail/providers/smtp'

const emailService = createEmailService({
  provider: smtpProvider({
    host: 'smtp.example.com',
    port: 587,
    secure: false, // use TLS
    user: 'username',
    password: 'password'
  })
})

// With advanced options
await emailService.sendEmail({
  from: { email: '[email protected]', name: 'Sender' },
  to: { email: '[email protected]' },
  subject: 'Test email',
  text: 'Plain text content',
  html: '<p>HTML content</p>',

  // SMTP-specific options
  priority: 'high', // 'high', 'normal', or 'low'
  dsn: {
    success: true, // Request successful delivery notification
    failure: true, // Request failure notification
    delay: true // Request delay notification
  }
})

@github-actions
Copy link

github-actions bot commented Apr 6, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 66.61% 1261 / 1893
🔵 Statements 66.61% 1261 / 1893
🔵 Functions 84% 63 / 75
🔵 Branches 68.03% 215 / 316
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/providers/smtp/index.ts 100% 100% 100% 100%
src/providers/smtp/provider.ts 23.47% 63.63% 25% 23.47% 42-79, 85-124, 130-142, 148-191, 214-215, 241-258, 278-423, 425-434, 441-469
src/providers/smtp/types.ts 100% 100% 100% 100%
Generated in workflow #14 for commit 6e1f9d3 by the Vitest Coverage Report Action

@productdevbook productdevbook merged commit 97414ae into main Apr 6, 2025
1 check passed
@productdevbook productdevbook deleted the smtp branch April 6, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants