Groups | Blog | Home
all groups > dotnet sdk > november 2006 >

dotnet sdk : SmtpClient accepts bogus values.


David Thielen
11/25/2006 7:11:01 PM
The following throws no exceptions - why?

SmtpClient client = new SmtpClient("bogus");
client.UseDefaultCredentials = true;
MailMessage mail = new MailMessage("bogus", "bogus", "Windward test email",
"This is an email sent from the Windward RePortal installer");
client.Send(mail);

Am I missing something? It seems to me that this should throw exceptions for
3 reasons (server, from, and to address).

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

v-phuang NO[at]SPAM online.microsoft.com (
11/27/2006 12:00:00 AM
Hi Dave,

Based on my test, the code does throw exception for the MailMessage ctor.
MailMessage mail = new MailMessage("bogus", "bogus", "Windward test email",
"This is an email sent from the Windward RePortal installer");

Once we changed the from/to email address below, the exception will gone.
"bogus@a.com", "bogus@a.com",

Also the format for the server name bogus is OK, because in LAN we can use
a smtp server name of such format but not a internal full qualified name.
e.g.(smtp.doamin.com).

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen
11/27/2006 7:48:01 AM
Now I am getting the exceptions here. I swear I wasn't before though. Weird.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
v-phuang NO[at]SPAM online.microsoft.com (
11/29/2006 12:00:00 AM
Hi Dave,

Yes, it is strange.
Anyway, if you have any other question, please feel free to post in the
newsgroup.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button