Send email via an InfoPath browser form in SharePoint
Learn how you can use an email submit data connection in InfoPath 2013 to send a simple email message via the browser in SharePoint 2013.
While there are several ways to send email via InfoPath in SharePoint with methods including workflows and code solutions, using a To Email submit data connection in InfoPath is by far the easiest and simplest method to send an email message using an InfoPath form in SharePoint.
In the InfoPath 2013 video tutorial below, you'll learn how to use a To Email submit data connection in InfoPath 2013 to send a simple email message through an InfoPath browser form in SharePoint 2013.
In this InfoPath 2013 tutorial video, you learned...
- How to add a view to an InfoPath form template that can be used to send a simple email message.
- How to configure an InfoPath form to be submitted using rules.
- How to add rules to submit an InfoPath form using an email submit data connection.
- How to send an email message using an InfoPath form in the browser via SharePoint 2013.
InfoPath with SharePoint 2013 video tutorial transcript
Here I'm in InfoPath Designer 2013, where I've already pre-created an InfoPath form template that has this sendTo text box control on it, this body rich text box control, and what I've also already added is an email submit data connection that submits the form to whatever email address I enter into the sendTo text box control. And it sends only the currently active view. If you do not know how to add an email submit data connection to an InfoPath form template, you can refer to recipe 37 of InfoPath 2013 Cookbook.
Because the data connection is only going to send the currently active view and what I want to place on that view is whatever the user enters in this rich text box control, I'm going to create a separate view and place this rich text box control on it, so that I can send only that message in the email.
So I'm going to create a new view called EmailView, I'm going to remove borders from this layout table, and also remove its header. I'll move it to the left, and then I'll drag-and-drop this rich text field onto the view, resize it a bit, and remove its borders. Because I don't want this EmailView to be accessible by users via the Current View menu, I'm going to remove it from the menu, so I'll deselect that check box.
Once you have created a separate view that can be sent in the email containing only this rich text box data, what you can do next is use rules to submit the form. For that I'm going to configure the submit options. And I'm going to perform custom action using rules.
As you can see, there is already one action here that submits the form to the email submit data connection. What I have to do before this is add one that switches to the EmailView. So you need to make the EmailView the currently active view before you send the email. And then I'll move this action up, so that it runs before this submit data connection.
I've already previously published this InfoPath form template to a SharePoint form library, so what I'll do is just republish it. Once the form template has been published, you can test the InfoPath form in SharePoint.
Here I'm in SharePoint 2013, where I've just published the InfoPath form template to this SendEmailLib SharePoint form library. As you can see, I'm currently logged in as user Jane Doe. Note that for this solution to work, you must first configure outgoing email for SharePoint.
I'll add a new form, and then enter an email address to send the message to. I'll send it to John Doe. And then I'll just enter a message here. And I'll make this text bold, a little bit larger, and I'll change its color. And then I'll submit the form to the email address, so I'll click Submit. So now we can go check on the email.
Here I've got the email that was sent open. As you can see, it was sent by the email address that was configured for outgoing email in SharePoint, it was sent to John Doe, it was submitted by Jane Doe, and this is the message that I typed into the rich text box control.
See more InfoPath 2013 tutorial videos »
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.
Related InfoPath Articles:
- How to send email from an InfoPath browser form in SharePoint
- Use a people picker with an email connection in InfoPath
- Submit InfoPath form and send SharePoint email with link
- Programmatically submit an InfoPath form to a SharePoint library, send an email, and then close it
- Send email from SharePoint based on values in an InfoPath form