emailgmail

Prevent Gmail from creating links for URLs and email addresses


Problem is Gmail automatically creates hyperlinks for all website URLs and email addresses. I do not want to create a link.

var mailClient = new SmtpClient();
var netMail = new MailMessage();

msg = "I do not want www.google.com as a link at recipient end. <br/>";
msg += "I want my email addrress myemail@myudomain.com as html without a link";

var cr = new NetworkCredential("########", "###########");

netMail.From = new MailAddress("########@m####.###", "######");
netMail.To.Add(new MailAddress("abc@xyz.com"));
netMail.Subject = "Test Mail";
netMail.IsBodyHtml = true;
netMail.Body = msg;

mailClient.Host = "xyz.com";
mailClient.Port = 25;
mailClient.EnableSsl = false;
mailClient.Credentials = cr;
mailClient.Send(netMail);

Any solution?


Solution

  • There's no way to stop creating URLs, because its automatically checked by the email provider that whether the text is a valid URL.

    Only way to overcome this is, deceiving the parser. Just put spaces, HTML tags, whatever in such a way that the parser can't identify like URL etc.

    Here are a few code examples:

    http:<span>//foolishedsiteparser.com</span>
    _http://www.parsersmashed.com
    noonesemail<x>@</x>linkdead.com>
    

    And the result is the following:

    http://foolishedsiteparser.com
    _http://www.parsersmashed.com
    noonesemail@linkdead.com