kaisellgren / mailer

Compose and send emails from Dart. Supports file attachments, HTML emails and multiple transport methods.
MIT License
166 stars 86 forks source link

how to get access token? #212

Closed mayur-16 closed 2 years ago

mayur-16 commented 2 years ago

I want to send email from my flutter windows app using gmail.

i tried to send mail using final smtpServer= gmail(fromuser, password); but it showing me its depreciated..

now am trying using smtpServer=gmailSaslXoauth2(fromuser, "access token");

how to get access token for gmailSaslXoauth2 ? or is there any other method for sending mail?

close2 commented 2 years ago

See the example in https://github.com/kaisellgren/mailer/tree/master/example/gmail_xoauth2

Much simpler: enable two-factor authentication and create an app password.