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.
Prerequisite: SMTP should be configured in SharePoint Central Admin.
Step 1: Select the Feature AppForms as shown in Figure 1.
Step 2: Create a New Folder and within that folder create a New Form.
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.
Step 4: Rename the controls as per the necessity, so that the finalized form will look like the one below.
Step 5:Navigate to Rule tab and click ‘Create Rule’ to create a new rule and add an action.
Step 6: Using ‘Expression builder’ generate the send email rule as per the below mentioned syntax and set a trigger to activate the rule.
Syntax:
SendEmailAdvanced(Subject, EmailBody, ToAddress, CCAddress, BCCAddress, FileUpload, ShowMessage, Message, From)
Description
Send Mail with form
Example:
SendEmailAdvanced(txtSubject.Value,rtbEmailBody.Value,txtEmailID.Value,”syrya@gmail.com”,”alphy@gmail.com”,fupAttachment.Value,true,”Mail sent Successfully”,”sam@gmail.com”)
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.
Step 8: On checking the recipient’s inbox, the email can be viewed.
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’.
Step 10: The rule is set as shown in Figure 13
Example:
SendEmailAdvanced(txtSubject.Value,rtbEmailBody.Value,txtEmailID.Value,”syrya@gmail.com”,”alphy@gmail.com”,fupAttachment.Value,true,”Mail sent Successfully”,”sam@gmail.com”)
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’.
Step 12: On checking the recipient’s inbox, the email can be viewed like the one below.