show / hide menu

Send Email functionality

Introduction

Send Email functionality in AppForms allows you to send an email along with\without attachments, so that the receiver will receive that email as soon as the button is triggered.

Step 1: Select the Feature Designer as shown in Figure 1.

Figure 1

Step 2:Create a New Folder and within that folder create a New Form.

Figure 2

Step 3: Open the form and drag the controls like ‘TextBox’, ‘Label’, ‘Rich Text Box’, ‘Button’ and ‘Border’ to design the form as shown in Figure 3.

Figure 3

Step 4: Rename the controls as per the necessity, so that the finalized form will look like the one below.

Figure 4: Designer
Figure 5: Preview

Step 5: Navigate to Rule tab and click ‘start’ to create a new rule and add an action.

Figure 6: Rule Tab

Step 6: Using ‘Expression builder’ generate the sendemail rule as per the below mentioned syntax and set a trigger to activate the rule.

Syntax:
SendMail(ToAddress, Subject, EmailBody, Attachment(optional), CC(optional), BCC(optional), Result(optional), From(optional), ReplyTo(optional))

Description

  1. ToAddress>>To address (multiple recipients can be semi-colon separated within double quotes)
  2. Subject>>Email subject
  3. EmailBody>>Email Body
  4. Attachment>>File attachment (optional)
  5. CC>>Carbon Copy Addresses (optional, multiple recipients can be semi-colon separated within double quotes)
  6. BCC>>Blind Carbon Copy Addresses (optional, multiple recipients can be semi-colon separated within double quotes)
  7. Result>>Show mail status (optional, default value is false)
  8. From>>From Addresses (optional)
  9. ReplyTo>>ReplyTo Addresses (optional)
Figure 7: Expression Builder

Example:
SendEmail(TextBox1.Value,TextBox2.Value,RichTextBox.Value)
OR
SendEmail(surya.claysys@gmail.com,”Form For Approval”,RichTextBox.Value)

Figure 8: Rule for SendEmail

OR

Figure 9: Rule for SendEmail

Step 7: Once the rule is set, check the preview and thereby clicking “Send“ button, which is set as a trigger, the email is sent to the corresponding recipients.

Figure 10

Step 8: On checking the recipient’s inbox, the email can be viewed.

Figure 11

Send an Email with files that are uploaded to the File upload control

In the ‘Send an Email’ property, the email can be send by attaching multiple files with the mail and send to the corresponding recipients.

It can be achieved by adding\configuring a file upload control into the form.
Step 9: In the properties of the ‘File Upload’ control, click the checkbox of ‘Allow Multiple File’.

Figure 12

Step 10: The rule is set as shown in Figure 13
Example:
SendEmail(TextBox1.Value,TextBox2.Value,RichTextBox.Value,FileUpload.Value)

Figure 13

Step 11: Check the ‘Preview’ and enter the values and upload the files into file upload control, as shown in figure below. And click ‘Send’.

Figure 14


Step 12: On checking the recipient’s inbox, the email can be viewed like the one below.

Figure 15