Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / November 2006

Tip: Looking for answers? Try searching our database.

SmtpClient accepts bogus values.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 26 Nov 2006 03:11 GMT
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).

Signature

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

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

"Peter Huang" [MSFT] - 27 Nov 2006 03:56 GMT
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

Signature

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

David Thielen - 27 Nov 2006 15:48 GMT
Now I am getting the exceptions here. I swear I wasn't before though. Weird.

Signature

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

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

> Hi Dave,
>
[quoted text clipped - 16 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 29 Nov 2006 03:10 GMT
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

Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.