We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SmtpClient raises exception


We are trying to connect to smtp client gmail to send emails but every time it raises exception on initialization statement:

SmtpClient client = new SmtpClient(“smtp.gmail.com”, 587, “username”, “password”);

I included the activity logging, but it doesn’t reach to that point and raises exception before that.

Attached is the exception detail and sample application.

Hi Acton,

Thank you for contacting Aspose Support team.

We have analyzed your shared information regard the exception raised by the SmtpClient and found that there are multiple instances of configuration elements your application. Please correct these and let us know if you still face any such issue? In case the issue still exists, please share your sample application with us that we can use to reproduce the problem at our end.

Hi Kashif,

Please check the attached project. I have removed the DLLs to reduce its size. Also, the smtp client log file is also empty. This happens with all the projects created on this specific PC. If I use Exchange client, it sends out emails without any issues.

Hi Acton,

The Exception details shared by you show that there are some firewall settings that are stopping the SmtpClient to send out email. Please check your firewall settings and let us know your feedback.