Time for action – calling the native e-mail application
In the following steps we'll make some fields and a button to try sending an e-mail feature:
Go to the Email card and create four fields. Name them To, CC, Subject, and Body.
Make a button named Test.
In the Test button, add this script:
on mouseUp
put field "To" into toText
put field "CC" into ccText
put field "Subject" into subjectText
put field "Body" into bodyText
revMail toText,ccText,subjectText,bodyText
end mouseUp
Select the Run tool and type in example information in each of the fields.
After setting up the Standalone Application Settings… and selecting the Test Target, click on the Test button.
What just happened?
One neat thing about the LiveCode syntax is that the code for mobile also works for desktop applications and vice versa. All being well, when you click on the Test button, you will find yourself in your default e-mail application ready to send the message that you had entered in the LiveCode stack fields.
Installing the e-mail test on devices
It's no great surprise that the desktop test worked. The ability to open other applications is the basic feature of LiveCode. Still, it's neat to send over some initial text for the new message to take on. Next, we should check whether this works on devices too.