HowTo: Using the SendEmail Method From Interop in Smart Devices Api

Official Content
This documentation is valid for:

 The Interop External Object which can be found under the folder Smart Devices Api provides several methods to interact with the device where the app is executing.

InteropEO

The SendEmail method provides us a way to send an email from our application. When this method is executed it opens the native email application of the device with a new email ready to be sent. You can call the method with three parameters:

To: Destinatary of the email. Based on the domain Email.
Subject: The subject of the email.
Message: Content of the email you want to send.

 

This article will show an example of how this feature is used.

Firstly, create a new Panel for Smart Devices object (i.e.called SDPanel):

InteropSDPanel

Add a variable based on the Email domain, and one variable based on VarChar(200) to the SDPanel for the message and other for the subject (in sendEmail method it doesn't matter the size of the varchar parameters passed to it, even though it asks for a varchar(200), it could receive a message of any size, for example bigger than 200). The variable based on Email is going to be the destinatary of the email.

sendEmailvari

Add the variables to the Section General (right click/Insert Variable) and add a new Action to the Layout (right click/Insert Action).

InteropAddVarActionToLayout

Make sure the variables has the property Readonly = False

On the event of the action (to go to the event of the action: double-click on the button) add the following code:

Event 'Email'
    Interop.SendEmail(&to,&subject,&theMsg)
EndEvent

Done! The entry panel will accept an email and a msg  when the button Send is tapped an email with the parameters in the To and Content field is going to be invoked.

sendemailiphone1

sendemailiphone2




Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.