After a user create account, I plan on displaying a link to lead user to the mail server of his email. For example : if user1 has user1@gmail.com, the link would point towards gmail.com or mail.google.com. if user2 has user2@yahoo.com the link would point towards mail.yahoo.com.
In PHP I can do
$domain = explode("@", 'user1@gmail.com')[1];
$domain2 = explode("@", 'user2@yahoo.com')[1];
$mailUrl = $domain; //will work
$mailUrl2 = $domain; //will not work
$mailUrl = 'mail.'.$domain; //will not work
$mailUrl2 = 'mail.'.$domain; // will work
So I cannot predict manually the submain structure. I was wondering if there is a PHP function or Laravel 4 package that returns me the proper subdomain for the email address like gmail.com, mail.google.com, mail.yahoo.com, hotmail.com, etc.