Page 1 of 1

mobileComposeHtmlMail - Will not allow CR? - Solved

Posted: Sat Feb 18, 2017 1:18 am
by DR White
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

Re: mobileComposeHtmlMail - Will not allow CR?

Posted: Sat Feb 18, 2017 3:41 am
by FourthWorld
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.

Re: mobileComposeHtmlMail - Will not allow CR?

Posted: Sat Feb 18, 2017 2:02 pm
by DR White
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

Re: mobileComposeHtmlMail - Will not allow CR?

Posted: Sat Feb 18, 2017 5:53 pm
by FourthWorld
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.