Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send email using OAuth

I am trying to send an email through gmail using oauth credentials. I cannot seem to find any smtp class in the framework, or open source alternatives that work with oauth access token.

I found these references on google developer's website Gmail IMAP and SMTP using OAuth - Overview and Gmail IMAP and SMTP using OAuth - Protocol, but I am not sure who to implement it.

  1. Are there any open source classes that support sending emails that are authenticated by oauth credentials?
  2. Is there any wrapper that helps write custom smtp calls ?

Thank you

like image 486
vondip Avatar asked Nov 05 '22 08:11

vondip


1 Answers

I think you can just use SmtpClient in the System.Net.Mail namespace.

This Q covers how to do it in detail: Sending Email via GMail and .NET 4

like image 53
Jude Fisher Avatar answered Nov 09 '22 17:11

Jude Fisher