Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-16
4
Medium Priority
?
772 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

660 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