May 9, 2014 at 4:09 PM
Edited May 9, 2014 at 4:09 PM
I am sorry but I am asking lots of questions again & again. But the developer who created this library I need your help..
Below are the steps which I am doing for sending an email. I am using Pop protocal
- FIRST : I am using "Pop3Client" object for Authenticating the email server I am initializing the Server Name, Port No, Username & Password.
- SECOND : After successfull Login into the email server I want to send email so I am using "SmtpClient" object and I am initializing the Server Name, Port No, Username & Password.
But the response which I am getting from the email server i SendMailResult State is
I don't know what thats mean exactly ?
Here is my code
using (Pop3Client objPop3Client = new Pop3Client("xxx"))
objPop3Client.ServerName = "xxx";
objPop3Client.Port = xxx;
objPop3Client.AuthenticateMode = Pop3AuthenticateMode.Pop;
objPop3Client.Ssl = true;
objPop3Client.UserName = "XXXt@XXX.XXX";
objPop3Client.Password = "XXXXX";
// Authenticating the Username and Password which is stored on the server
SmtpMessage mg = new SmtpMessage();
mg.Subject = "title";
mg.BodyText = "Hi.my mail body text!";
//Send by HTML format
mg.IsHtml = true;
MailAddress objmailAdress = new MailAddress("email@example.com");
mg.From = objmailAdress;
using (var objSmtpclient = new SmtpClient("XXX"))
objSmtpclient.ServerName = "XXX";
objSmtpclient.Port = 465;
objSmtpclient.EncryptedCommunication = SmtpEncryptedCommunication.Ssl;
SendMailResult objSendMailResult = objSmtpclient.SendMail(mg);
if (objSendMailResult.SendSuccessful == false)
//You can get information about send mail is success or error reason
var resultState = objSendMailResult.State;
//Do something. ex)show a complete message
May 9, 2014 at 4:37 PM
Edited May 9, 2014 at 5:15 PM
SendMailResult State is Authenticate
That means you fail authenticate to smtp server.
Your code looks that you don't set UserName,Password of SmtpClient object (not Pop3Client object).
Please try to set other value of SmtpClient object or server settings about username or password or ensure port is opened.
I solved my issue with your help... Thanks again