Saving a text file looses CR

If we are confused…

Hahaha. I hate not being able to fix mistypes and errors.

If we are confused, the best way to know is a sample.

That didn’t work either.

Here is the text that was typed into a TextArea:

Dear Member,

Attached please find you renewal reminder invoice. You may renew online at https://aspe.org/RenewMembership.

Thank You

ASPE Membership

Ok, I’ll create a sample here.

Richard, how are you sending the email?

First thing found, a textArea text is already UTF8.

And ReplaceLineEndings( txtArea.Text, EndOfLine.Windows) works. The CR+LF pair is there.

The problem Richard lives is another thing. :wink:

I remember something about saving files in Mac in Xojo’s Release Notes. I found this:

23874
MacCocoa: EndOfLine has changed from being a carriage return to a linefeed. EndOfLine.OSX has been added, which returns the linefeed.

This change will break applications which rely on EndOfLine being a carriage return. Those applications should switch to explicitly specifying EndOfLine.Macintosh or Chr(13).

Is this what you are looking for?

I’m setting the body like: mail.BodyHTML = txtBodyOfEmail.Text

mail is EmailMessage

  lemEmailMsg = GetEmailMessage(rs.Field("PersonID").StringValue, rs.Field("Email").StringValue, lfiSavePDF, rs.Field("Name").StringValue)
  SMTPSocket1.messages.append lemEmailMsg

Thats it

Figured it out.

Needed to use mail.BodyPlainText instead of BodyHTML

DUH!

Found your problem. You are submiting text and HTML. LF’s are like spaces in this encoding. You need tags.

OK, first off, use:

mail.BodyPlainText = txtBodyOfEmail.Text

Second, if that doesn’t solve the problem, encode that text as quoted printable:

See… EncodeQuotedPrintable

Well, Richard, you beat me to it. Good work.