Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get domain name from an email address

People also ask

How do I get a domain name from an email in Excel?

To extract domain from email address Select a blank cell to place this formula =RIGHT(A2,LEN(A2)-FIND("@",A2)), press Enter key, and drag fill handle down to the cells which need this formula.

How can I find out where an email is registered to a domain?

Go to the website, just enter the domain name of your desired company like ampercent.com to find email addresses available in that domain. It will look out for sources mentioning the email address with tailing @ampercent.com string and give your results along with number of sources containing that address.

Can you get domain name on Gmail?

Here's how to set up Gmail with your domain name for a personalized and professional looking email address: Go to Google Apps Gmail page, click the “Get Started Button.” Enter the name of your business and choose the number of employees or users. Pick the company's location.

What is domain name in an email address?

A domain name (often simply called a domain) is an easy-to-remember name that's associated with a physical IP address on the Internet. It's the unique name that appears after the @ sign in email addresses, and after www. in web addresses.


Using MailAddress you can fetch the Host from a property instead

MailAddress address = new MailAddress("[email protected]");
string host = address.Host; // host contains yahoo.com

If Default's answer is not what you're attempting you could always Split the email string after the '@'

string s = "[email protected]";
string[] words = s.Split('@');

words[0] would be xyz if you needed it in future
words[1] would be yahoo.com

But Default's answer is certainly an easier way of approaching this.


Or for string based solutions:

string address = "[email protected]";
string host;

// using Split
host = address.Split('@')[1];

// using Split with maximum number of substrings (more explicit)
host = address.Split(new char[] { '@' }, 2)[1];

// using Substring/IndexOf
host = address.Substring(address.IndexOf('@') + 1);