Sending email from Panorama

I have recently been using the great databases I downloaded from the Panorama Database Exchange for sending emails directly from Panorama (Mailbox and Composer, written by James Cook). It has been working well so far. Now I’m trying to send a plain text email, and it seems to be stripping the returns from the text, making it all one long paragraph. I tried changing the returns to line feeds in the original text using crtolf(, but that didn’t help.

My text has some links to web sites, so I’m wondering if it is assuming that my text is html and deleting the returns as a result. How does Mailbox determine whether something is plain text, html or something in between? I know the documentation says it’s based on whether or not a </body> or </html> appears in the text, but maybe there is more nuance to this decision?

And if it’s not thinking my text is html, why would the returns be deleted?

I don’t see a reason for the paragraph breaks to be removed.

There is a point where it evaluates whether or not the message is plain text after loading the message text to a variable named lvHTML. There it converts double returns to html paragraph breaks and single returns to an html line break. But to remove them altogether…?

If lvHTML notcontains "</"   ;lacks HTML formatting
   lvHTML = "<p>"+replace(replace(replace(htmlencode(lvHTML),¶+¶,"</p><p>"),¶,"<br />"),"  ","&nbsp;")+"</p>"

Your crtolf( would do better as lftocr( and my script could be updated to use cr( instead of ¶ but I still see no reason for the total strip.

Does it honor the breaks if you don’t have the links included? Possibly the format of your link has an influence - could you post an example?

For ease, I’ll send you directly the original text I sent to Mailbox, and then in a separate email the email I received in my in-box from Mailbox. It will probably be easier to trouble-shoot that way.

That’s a huge piece of text to break down, and I can’t be sure that what I received as email is the text as it started.

I can make some quick observation though. If this is supposed to be a Plain Text email, you have a lot of HTML tags in it. There are several formatted links and several unformatted links. Plain text doesn’t need the href tags added.

You also have a number of [–> and <–] tags embedded that seem to have an intended purpose, but…??

In trouble shooting this, I’d start with a much simpler version. Try just your opening lines for starters. Then try just one of those 20 or so paragraphs with the links and test with that.

Since you are using HTML tags, try sandwiching the whole thing in the basic tags of <html><body> and </body></html>.

I suspect that this message is being copied and pasted from elsewhere, possibly something else is being embedded where the line breaks are expected. Looking at the RAW Source of the email, every line wrap is marked with a =. Paste it into Text Edit and change to Plain Text. What does that do?

I’ll stand by the comments about cleaning up the links, but I did find how to re-create your loss of paragraphs and I can clean it up programatically. I’m working on that resolution now.