|
VerySimple Developer Blog
Technical Tips, Tricks and Rants.
Comments:
2 Comments posted on "Send an Email via SMTP with C#"
Nhilesh Baua on November 29th, 2007 at 2:08 am #
I am using almost same code in a winform application, however I am facing a very weird problem. I am trying to send the mails to around 200 mail ids at once but unless I close the application the mails are not sent actually. As soon as i close the application norton antivirus scans the mails which are stored in “Queue” folder one by one. I want the mails should be sent and cleared as soon as the send button is clicked. Also one BIG problem is this class does not provide with the exact exception occoured if the mail is not sent due to some reason. Any Ideas? Regards
Jason on December 1st, 2007 at 2:42 am #
Hey Nhilesh, it sounds like the problem is not with your application, rather with Norton - or possibly your smtp host. The mail should go out as soon as you call the send() method. One thing you might also try, send the email asynchronously and you can attach an event listener when the SendCompleted event is fired. There is some sample code to do that on this page - http://msdn2.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx Post a comment
|
|
||||||||||||