Solved

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

Posted on 2009-05-16
4
725 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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