H
HK
In VB.NET, I'm getting the exception "failure sending mail". I'm running VS
2005 on XP Home. This is a new install on a new PC. I've never had email
problems with VS 2003, and there I could modify the SMTP settings in IIS.
But with this install, there is no IIS (at least I can't find an IIS with
MMC browsing the snap-ins). I suspect that is part of the problem but I
don't know the solution and I have to be able to test sending email from my
developer machine.
Here's the code that causes the exception:
Dim Mail as System.Net.Mail.MailMessage = New
System.Net.Mail.MailMessages(strFrom,strTo)
... set Mail properties
Dim Client as System.Net.Mail.SmtpClient = New
System.Net.Mail.SMTPClient("localhost")
Client.UseDefaultCredentials = True
Client.Send(Mail)
That last line triggers the exception.
What is the solution? Thank you.
2005 on XP Home. This is a new install on a new PC. I've never had email
problems with VS 2003, and there I could modify the SMTP settings in IIS.
But with this install, there is no IIS (at least I can't find an IIS with
MMC browsing the snap-ins). I suspect that is part of the problem but I
don't know the solution and I have to be able to test sending email from my
developer machine.
Here's the code that causes the exception:
Dim Mail as System.Net.Mail.MailMessage = New
System.Net.Mail.MailMessages(strFrom,strTo)
... set Mail properties
Dim Client as System.Net.Mail.SmtpClient = New
System.Net.Mail.SMTPClient("localhost")
Client.UseDefaultCredentials = True
Client.Send(Mail)
That last line triggers the exception.
What is the solution? Thank you.