I have the following code that I’m using to open up the default email client on the system and the line feeds are not making it to the email client. It’s just one long line in the body. I checked the string, body and it’s fine. Once this line of code is run the issue occurs.
I know it’s different. The body text is a string straight from a TextArea control typed in by the user. Before putting it in the URL, I displayed it in a MessageBox and it looked fine. That has me scratching my head.
This is strange. I do need to use the EncodeURLComponent to prevent one big line and that’s fine. I’ve tried replacing the Endofline characters and it looks right in the new email created, but when it sends, there’s only a single line between each line even if I’d hit CR a few times. Frustrating!
Any ideas? The test email is from windows is using Thunderbird as the email client. When my code sends the email text to the Thunderbird client and creates the new email to be sent, all looks fine. When the email arrives at the recipient’s email the email there’s only 1 linefeed even when there should be more.
It actually wasn’t the email client that was the issue. I found some mistakes in my code after trying to implement the recommended changes. I have it working now.
After much tinkering and fixing some mistakes in my code. I have it fixed with using 2 suggestions made.
I had to search my string and make sure properly change the EndOfLine value to that used by windows.
I had to use the EncodeURLComponent. I did find that in my situation, this works for Windows and Linux, but is not needed for MacOS and actually screws it up on MacOS.
In any case, it’s all working now for all 3 Desktop OSs.
That’s what I thought, it’s been working for me without out it on MacOS. When I tried it on MacOS, it screwed it up. I don’t understand that, but it’s working fine now without it on the Mac.