Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 50337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:34:39+00:00 2026-05-10T16:34:39+00:00

Given the email address: Jim <jim@example.com> If I try to pass this to MailAddress

  • 0

Given the email address: ‘Jim’ <jim@example.com>

If I try to pass this to MailAddress I get the exception:

The specified string is not in the form required for an e-mail address.

How do I parse this address into a display name (Jim) and email address (jim@example.com) in C#?

EDIT: I’m looking for C# code to parse it.

EDIT2: I found that the exception was being thrown by MailAddress because I had a space at the start of the email address string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:34:40+00:00Added an answer on May 10, 2026 at 4:34 pm

    If you are looking to parse the email address manually, you want to read RFC2822 (https://www.rfc-editor.org/rfc/rfc822.html#section-3.4). Section 3.4 talks about the address format.

    But parsing email addresses correctly is not easy and MailAddress should be able to handle most scenarios.

    According to the MSDN documentation for MailAddress:

    http://msdn.microsoft.com/en-us/library/591bk9e8.aspx

    It should be able to parse an address with a display name. They give "Tom Smith <tsmith@contoso.com>" as an example. Maybe the quotes are the issue? If so, just strip the quotes out and use MailAddress to parse the rest.

    string emailAddress = "\"Jim\" <jim@example.com>";  MailAddress address = new MailAddress(emailAddress.Replace("\"", "")); 

    Manually parsing RFC2822 isn’t worth the trouble if you can avoid it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given an email address (ex: goelv@example.com), how do I validate that the domain (example.com)
Given an email address, say: bob@google.com In Coldfusion, how can i validate that the
i want to check to see if a given email say for example (yourname@your_domain.com)
Given an eMail address, I am trying to determine if it is a valid
How can I check the given email id is valid or not using ELIPS
I just want to get email id of user having phone number given. so
Given an email address, how can I verify that it is valid? (That the
I've been given this code to utilize to test out, and verify if email
Given an email address column, I need to find the position of the @
I have created some code that emails an html email to a given address.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.