mobileComposeHtmlMail - Will not allow CR? - Solved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

mobileComposeHtmlMail - Will not allow CR? - Solved

Post by DR White » Sat Feb 18, 2017 1:18 am

I am trying to put a small summary report in the body of an email, but I am not able to move my text to the next line.

My code is as follows:

global tEmailBody
on mouseUp

put "Person: " & "David" & cr & "Allergen: " & " Water" & cr & "Severity: " & "Mild" & cr & "Reaction: " & "Rash" & cr & "Note: " & "None" into tEmailBody


if mobileCanSendMail () is true then
put empty into tAttachment["data"]
put "text/plain" into tAttachment["type"]
put "Greetings.txt" into tAttachment["name"]
mobileComposeHtmlMail "Report Summary ", "davidwhiteapps@gmail.com",,,tEmailBody,tAttachment
end if

end mouseUp

The text int the body of the email shows up as one continuous string.
What am I doing wrong?

Thanks,

David
Last edited by DR White on Sat Feb 18, 2017 2:02 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: mobileComposeHtmlMail - Will not allow CR?

Post by FourthWorld » Sat Feb 18, 2017 3:41 am

mobileComposeMail accepts plain text as the body portion of the email.

mobileComposeHtmlMail accept HTML as the body.

HTML ignores returns and most other white space, relying instead on either "<p>" and "</p>" surrounding paragraphs, or using "<br>" for line breaks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: mobileComposeHtmlMail - Will not allow CR?

Post by DR White » Sat Feb 18, 2017 2:02 pm

Richard,

Your information was most helpful and needed.
It was pretty immature of me not to look at all the keywords with email.
I just used the first one I saw, sorry.

Thanks again for explaining in such detail the difference between the two,

David

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: mobileComposeHtmlMail - Will not allow CR?

Post by FourthWorld » Sat Feb 18, 2017 5:53 pm

DR White wrote:Your information was most helpful and needed.
It was pretty immature of me not to look at all the keywords with email.
I just used the first one I saw, sorry.

Thanks again for explaining in such detail the difference between the two,
Happy to help, David. I appreciate your kind words.

The LiveCode language is broad and deep enough that when in doubt about something that doesn't seem to work as I expect I'm quick to consult the Dictionary.

But don't feel bad that you didn't. It's one of those habits you pick up over time. LC is seductive in the sense that so many things are so easy that at first we expect everything will be self-evident. But as we go we find that it's still a programming language, with its share of nuances and details that need to be learned like any other.

And of course whenever we're stuck we have these forums. Never be shy about using them, even for questions that may seem simple. I've found that for any question there are at least 20 people who wonder the same things but didn't ask it. Asking questions here is a service to the community.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply