Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Email address FormatException

Reply
Thread Tools

Email address FormatException

 
 
Marcus Michaels
Guest
Posts: n/a
 
      07-26-2010
Hi folks,

I am recently experiencing an issue, where correctly formatted email
addresses can not be passed to the MailAddress constructor.

I use a string variable to assign he address and the code breaks with a
FormatException thrown.

I saw other posts referring to issues in the web.config, but I have no issues.
Most addresses are fine, but the ones throwing an exception can be added as
text directly and worj fine.

A sample

dim e as string
e=""

Dim objMail As MailMessage = New MailMessage
objMail.To.Add(e)

the statemet above fires the error.

Dim objMail As MailMessage = New MailMessage
objMail.To.Add("")

works perfectly though.

Any hints???

Marcus


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.FormatException: String was not recognized as a valid DateTime RSH ASP .Net 1 03-14-2009 05:47 PM
CreateUserWizard FormatException for e-mail address Avi ASP .Net 1 11-16-2006 07:43 AM
FormatException: Input string was not in a correct format. Maria ASP .Net 4 04-04-2004 03:10 PM
System.FormatException: Input String was not in a correct format. sbox ASP .Net 2 02-15-2004 04:01 PM
System.FormatException on Mobile Application Sachin K ASP .Net Mobile 0 08-01-2003 06:23 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57