Transaction Dialogue with POP3/SMTP Server (How to get log of telnet session?)

Greetings,

I know in other compoents that you can trap an exception while sending mail or receiving mail where they will expose a property that allows you to see the full dialogue with the server at the other end. In the case of any type of mail failure I would like to push the text of the telnet connection (i.e. log with server) to the event log when I write the error to the log. As can be imagined this gives the step by step of the actual connection and makes troubleshootnig much easier.

Can this be accomplished with this email component?

Hi,

Thanks for considering Aspose.

I am sorry, currently there is no such property for SmtpClient or Pop3Client class to get the log of client/server communication messages. I have forwarded this suggestion to our developers and they will consider adding it in future. It is also now added in our issue tracking system (ID: 12106) and you will be notified about the progress here. Thanks for the patience.

Has this been implemented into the Aspose.EMail yet?

I need to know if the msg sent was actually received/Queued on the receiving SMTP server in order to log success/failure for msg sent.
If it did not send we need to know why.


Hi Aneil,

I would like to share that SmtpClient activity log can be obtained now. Please have a look at this link which shows complete steps to retrieve SmtpClient activity log.

You may also please visit SmtpStatusCode which provides status of the current client activity. Following sample code can be used to get these SmtpStatusCodes:

static void SendMsgUsingSmtp()
{
SmtpClient client = GetSmtpClient();
MailMessage mail = new MailMessage("User1@gmail.com", "User2@gmail.com", “Test Subject”, “Test Body”);
try
{
client.Send(mail);
}
catch (SmtpException ex)
{
Console.WriteLine(“Status Code:” + ex.StatusCode);
}
}
static SmtpClient GetSmtpClient()
{
SmtpClient client = new SmtpClient();
client.Host = “[smtp.gmail.com](http://smtp.gmail.com/)”;
//Specify your mail user name
client.Username = “username”;
//Specify your mail password
client.Password = “password”;
//Specify your Port #
client.Port = 587;
client.EnableSsl = true;
client.SecurityMode = SmtpSslSecurityMode.Explicit;
return client;
}

Please feel free to write us back if you have any other query in this regard.