I've followed the sample given here -http://blog.rebex.net/howto-authenticate-gmail-rebex-oauth/. I'm trying to setup an outlook email account. I'm successfully able to get the access token.
var client= new Smtp();
client.Connect("smtp-mail.outlook.com", SslMode.Explicit);
client.Login(token,SmtpAuthentication.OAuth20);
token here is base64 -encoded string , just like you've shown for gmail. ( Ref - https://msdn.microsoft.com/en-IN/library/dn440163.aspx )
Login statement throws this exception -
{Rebex.Net.SmtpException: OAuth failed: OAuth authentication failed due to Invalid token. Code -2147184118 (535).
at Rebex.Net.Smtp.JRR(String T, String R, SmtpAuthentication J, GssApiProvider C)
at Rebex.Net.Smtp.JG(String T, String R, SmtpAuthentication J)
at Rebex.Net.Smtp.Login(String token, SmtpAuthentication method)
Please note that I'm trying to do this for @outlook account and not office 365. I've tried this with - smtp.live.com as well but no luck.
I've passed these scopes for authentication - https://outlook.office.com/Mail.ReadWrite https://outlook.office.com/Mail.Send openid profile.
Please let me know if I'm missing anything here?
Also, If you could also provide information on the following things -
1. Is there a future plan to provide support for Gmail REST API , Outlook REST API to send mails
2. Giving SSL.Implicit for Outlook doesn't work. Any reason for it?
Any inputs are appreciated. Thank you!