Solved

the specified string is not in the form required for an email address

Posted on 2009-05-16
4
717 Views
Last Modified: 2013-11-07
Hi folks,

I am getting the below error when sending the mail using smtp in asp.net 2.0 with c#.

Unhandled Exception: System.FormatException: The specified string is not in the form required for an e-mail address.
   at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
   at System.Net.Mail.MailAddress.ParseValue(String address)
   at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
   at System.Net.Mail.MailAddress..ctor(String address, String displayName)
   at MailAddressDotted.Main(String[] args) in c:\Temp\2007-08\MailAddressDotted.cs:line 16

Please let the know solution of this problem.

Thanks in advance

Glenn
0
Comment
Question by:dotsandcoms
  • 2
4 Comments
 
LVL 14

Expert Comment

by:Dustin Hopkins
ID: 24402596
could you please provide any relevant code.

Hope this helps,
Dustin
0
 
LVL 12

Accepted Solution

by:
techExtreme earned 500 total points
ID: 24403748
Can you paste code from your file "MailAddressDotted.cs"  so that I can have a look at the code?
However, check that your 'mail From Address' and 'TO Address' have real email addresses.  for example you might have written address as "john" instead of "john@something.com"  .
0
 
LVL 12

Expert Comment

by:techExtreme
ID: 24411894
It is stated that the error was 'due to invalid email id.'. That same solution I have provided, so I think that should be the correct answer in my opinion. I have written that email address might be wrong like 'john' instead of 'john@something.com'.  So in a way my solution is correct, rest is upto the moderator. Thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question