Joannis / VaporSMTPKit

SMTP support in Vapor 4
58 stars 11 forks source link

Can't sending emails #12

Open epodkorytov opened 1 year ago

epodkorytov commented 1 year ago

Hi, @joannisorlandos!

I'm using code from the example.

Can I send emails from a local server?

let email = Mail(from: "email1@gmail.com", to: [MailUser(name: "Myself", email: "email2@gmail.com")], subject: "Your new mail server!", contentType: .plain, text: "You've set up mail!" )

extension SMTPCredentials { static var default: SMTPCredentials { return SMTPCredentials( hostname: "smtp.gmail.com", ssl: .startTLS(configuration: .default), email: "email1@gmail.com", password: ) } }

[ NOTICE ] Server starting on http://127.0.0.1:8080 [ INFO ] GET /sendEmail [request-id: 4341D182-D565-485C-B45C-75431EEC1C47] [ WARNING ] SMTPKitten.SMTPError.loginFailure [request-id: 4341D182-D565-485C-B45C-75431EEC1C47]

landtanin commented 9 months ago

Got a similar issue, loginFailure. In my case, I had to create a Google App Password (email1@gmail.com in your case).

Using the new app password works for me.