Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sending an e-mail


Mobile devices often support e-mail clients. We can use LiveCode to interact with the mobile device's e-mail system. This recipe illustrates the relative ease in sending an e-mail from within a mobile app developed with LiveCode.

How to do it...

Follow the given steps to send an e-mail:

  1. Create a new LiveCode stack.

  2. Set the background color of the default card to black.

  3. Drag a new button to the card and set the following properties:

    • Name: btn_sendEmail

    • Label: Send Email

    • Width: 144

    • threeD: Keep it unchecked

    • showBorder: Keep it unchecked

    • hiliteBorder: Keep it unchecked

    • backgroundColor: White

  4. Add the following code to the btn_sendEmail button:

    on mouseUp
      revMail
    end mouseUp
  5. When you run the app in the simulator and click on the Submit button, you should see the e-mail client appear, as illustrated in the following screenshot:

How it works...

LiveCode makes our work easy when it comes to invoking the e-mail client. We made a call to the revMail command and the e-mail client's New Message...