473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Failure Sending Mail exception with VS 2005

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.

Mar 20 '06 #1
2 10121
HK,

The problem is in XP home, that has no IIS server and therefore as well no
IIS mail server.

You can use however any SMTP server that allows this.

I hope this helps,

Cor

"HK" <re**************@notreal.com> schreef in bericht
news:3p*****************@tornado.socal.rr.com...
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.

Mar 20 '06 #2
HK
I don't understand. Actually, I understand but it doesn't make sense.
Much was said by Microsoft about how VS2005 would have an IIS subsitute that
handled web requests (for testing ASP.NET) on random ports for security
reasons. I heard many times that developers could now do all their testing
with XP Home and not need to buy XP Pro. Are you saying that their IIS
substitute can't handle sending an email from the machine by itself? That
sounds like a good guess, but are you sure? If so, that's a big downfall
because developers would not be able to test "the same" code before putting
it online on a real server. I really hope Microsoft didn't do this.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:ey**************@TK2MSFTNGP12.phx.gbl...
HK,

The problem is in XP home, that has no IIS server and therefore as well no
IIS mail server.

You can use however any SMTP server that allows this.

I hope this helps,

Cor

"HK" <re**************@notreal.com> schreef in bericht
news:3p*****************@tornado.socal.rr.com...
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.


Mar 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
3
by: amitbhanage | last post by:
I try to send the mail using asp.net 2005 The code I am using is Try Dim strTo As String = "to@yahoo.com" Dim strFrom As String = "from@gmail.com" Dim...
1
by: KUTTAN | last post by:
I am trying to send emailes ,but it leades to exeption the exeption message is "Failure sending mail." Try Dim message As New MailMessage()
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
2
by: Danny | last post by:
Hi all, Trying to send mail with System.Net.SmtpClient, using very simple code just for testing: SmtpClient smtp = new SmtpClient("mail.server.com", 25); smtp.Credentials = new...
2
by: shil | last post by:
Hi all, I'm using System.Net.Mail (Framework 2.0) to send emails on scheduled basis. This works great on Windows 2000 server. Rently we have upgraded our servers to Windows 2003. Since then some...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
5
by: Don Quijote de Nicaragua | last post by:
Hi, everyone I try to send a simple e-mail witch this Code, but always send me a error messages: "ERROR: Failure sending mail." Thansk You. Don Quijote de Nicaragua. Elder Soto. Dim correo As...
1
by: jagdeep gupta | last post by:
10.2 How to send emails by using System.Net.Mail CODE-BEHIND: MailMessage message = new MailMessage(); message.From = new MailAddress("fromusername@DomainName"); message.To.Add(new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.