1

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?

Nirman
  • 6,715
  • 19
  • 72
  • 139
  • Inserting a dot before line break [is a common work-around for `MailMessage` stripping newline characters](https://stackoverflow.com/a/3931421/335858). You are sure that some other part of your team's code is not inserting the duplicate dots, right? – Sergey Kalinichenko Dec 07 '17 at 11:52
  • actually, my code is not inserting a dot before linebreak. for example, there is a link "http://www.mywebsite.com" in the email body, and if one of the dot comes as a first character in the new line, it gets convereted to two dots. I also observed, line break in this case happens automatically based on character count. I guess, each line contains 69 characters. It may be a behavior of outlook or exchange. – Nirman Dec 07 '17 at 12:00
  • 1
    Yes, I have made sure no team member is inserting duplicate dots. In fact, I can see the URLs showing up properly in Gmail and other clients. – Nirman Dec 07 '17 at 12:00

1 Answers1

1

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.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Kundan
  • 22
  • 5
  • Hi Kundan, I very much appreciate your response on this. But the issue we are facing is no the production environment where we are sending actual emails to the users. Are you sure you are not facing this issue in actual emails? In that case, it may be a different issue at my end! – Nirman May 30 '19 at 13:08