joannis/vaporsmtpkit
Add this library to `Package.swift`
Setup
import VaporSMTPKit
extension SMTPCredentials {
static var `default`: SMTPCredentials {
return SMTPCredentials(
hostname: "smtp.example.com",
ssl: .startTLS(configuration: .default),
email: "noreply@example.com",
password: "<SECRET>"
)
}
}Sending a Mail
app.get { request -> EventLoopFuture<String> in
let email = Mail(
from: "noreply@example.com",
to: [
MailUser(name: "Myself", email: "me@example.com")
],
subject: "Your new mail server!",
contentType: .plain,
text: "You've set up mail!"
)
return request.application.sendMail(email, withCredentials: .default).map {
return "Check your mail!"
}
}Package Metadata
Repository: joannis/vaporsmtpkit
Default branch: master
README: README.md