Failure sending mail - by Dan1

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 548727 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 4/5/2010 3:42:59 AM
Access Restriction Public


A program written in VB 2007 was sending SUCCESSFULLY e-mails to users, over a Virtual SMTP Server in IIS 6. 
After converting the program to Visual Studio 2010 RC, it throws the exception 
"A first chance exception of type 'System.Net.Mail.SmtpException' occurred in System.dll
>>>SendMail/Exception: Failure sending mail.
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at EmailNotif.Form2.SendEmail(String strFileName) in E:\IRIS\VS-NET-Production\EmailNotif\EmailNotif\Form2.vb:line 226"
I am not aware of any changes with the exception of VS 2010 and Microsoft Updates
Sign in to post a comment.
Posted by Dan1 on 6/26/2010 at 9:11 AM
Thank you very much for your comments.
The program was working as expected before installing VS2010. No doubt.
We gave up, waiting for a hint from Microsoft.
Then after a while, when we tried again, magic! It works again, possibly after installing an update.
Thanks again.
Best regards,
Posted by Microsoft on 6/26/2010 at 8:28 AM
Dan, I have checked the sample code you uploaded and found that you were inappropriately re-using disposed MailMessage objects. Checking the Exception.InnerException field explains this. No disposed objects in .NET should be reused.

Your code sample did not appear to work in prior versions either. If you believe the upgrade to VS 2010 broke the project, please upload a copy of the original project so we can reproduce the upgrade process.
Posted by Dan1 on 4/23/2010 at 4:53 AM
After installing VS 2010 Release the exception message became
>>>SendMail/Exception: Unable to send to all recipients.
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at EmailNotif.Form2.SendEmail(String strFileName) in E:\IRIS\VS-NET-Production\EmailNotif\EmailNotif\Form2.vb:line 226
Posted by Microsoft on 4/18/2010 at 8:25 PM

Thanks for your feedback.

We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.
These specialized experts will follow-up with your issue.
Posted by Dan1 on 4/15/2010 at 7:05 AM
I just submitted, for the third time, the source file.
Posted by Microsoft on 4/12/2010 at 11:49 PM
Hi, given that we have not heard back from you, we will go ahead and close this Connect Issue. If you get a chance to review and provide the information requested earlier, you can go ahead and reactivate this issue.(Click “Edit this item” button on the site and change the “Status” to “Active”)
Posted by Microsoft on 4/6/2010 at 1:24 AM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Could you please attach a zipped project file to this feedback through our site to help us reproduce the issue?

Thanks again for your efforts and we look forward to hearing from you.
Visual Studio Product Team
Posted by PJ on Development on 4/5/2010 at 7:22 AM
It would be nice to add a snippet of the code that's causing the problem.

This way, people could tell you if this is a bug with VS2010 or a faulty code.