Hi, I am trying to send email using the below code in WinRT App, but the Authenticate() call is returning false in spite of using correct uid (full email id) and password. Can anybody help? Also, note that below I used authentication using uid and password,
but finally intend to use oAuth access token. Any guidance in this regards will be helpful as well. (Please note that I can use the code below for GMail, with SSL channel. When I use SSL with live, the Open() call throws exception "System.Exception: The
token supplied to the function is invalid (Exception from HRESULT: 0x80090308)", but with TLS Open() call succeeds. Using "smtp.live.com" gives the same result).
HigLabo.Net.Smtp.SmtpClient cl = new HigLabo.Net.Smtp.SmtpClient();
cl.ServerName = "smtp-mail.outlook.com";
cl.Port = 587;
cl.EncryptedCommunication = HigLabo.Net.Smtp.SmtpEncryptedCommunication.Tls;
cl.UserName = "email@example.com";
cl.Password = "xyz";
cl.AuthenticateMode = HigLabo.Net.Smtp.SmtpAuthenticateMode.Auto;
if (cl.Open() != HigLabo.Net.Smtp.SmtpConnectionState.Connected)
HigLabo.Net.Smtp.SmtpMessage mg = new HigLabo.Net.Smtp.SmtpMessage();
mg.Subject = "title";
mg.BodyText = "Hi.my mail body text!";
//Send by HTML format
mg.IsHtml = true;
mg.From = new HigLabo.Net.Mail.MailAddress("firstname.lastname@example.org");
//Add attachment file from local disk
var rs = cl.SendMail(mg);
//Check mail was sent or not
if (rs.SendSuccessful == false)
//You can get information about send mail is success or error reason
var resultState = rs.State;
Thanks in advance.
Feb 6, 2014 at 10:34 PM
Recently, I have had a trouble caused by jstedfast.
I had taken so much time to handling it.
Sorry inconvenience that you are waiting for.
I'll check WinRT code then I could have a time.