Solved

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

Posted on 2009-05-16
4
743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

623 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