Search code examples
asp.net.netencodingoutlookmailmessage

Email body containing dot (.) in the URL gets replaced by two dots


I have written code to send emails from my .NET application. Application sends emails successfully. The emails contain number of hyperlinks each inside anchor tags. However, if I try to open emails in the outlook client, it is converting single dot to two dots in the URL. I analyzed the pattern and I could see it happening only when the dot character in URL is the first character of a new line in outlook email. Outlook sets lines automatically, so I do not have control over it.

While forming the body contents, I am setting the "BodyEncoding" property of MailMessage object to System.Text.Encoding.UTF8, but that doesn't make difference in the output.

Could anyone please help what could be the reason, and how to resolve this issue?


Solution

  • I have been facing similar issue when i was trying to save mail in Directory using web.config file.

    <system.net>
        <mailSettings>
          <smtp deliveryMethod="SpecifiedPickupDirectory">
            <specifiedPickupDirectory pickupDirectoryLocation="c:\TestMails\"/>
          </smtp>
        </mailSettings>
      </system.net>
    

    This issue has been resolved, when sent mail directly to Mail address.