// This module is included in these assemblies:
// as_connecting-to-gmail.adoc

[id='add-gmail-connection-finish-middle_{context}']
= Sending an email from a Gmail account

In an integration, you can send an email from a Gmail account either
in the middle of a flow or to finish a simple integration.  
To do this, add a Gmail connection to the middle of a flow or as 
a simple integration's finish connection. 

.Prerequisites

* You created a Gmail connection. 
* You are familiar with the
link:{LinkSyndesisConnectorGuide}#alternative-for-populating-email-to-send_gmail[alternatives for populating an email to send]
and you have a plan for populating such emails. 
* {prodname} is prompting you to add to the integration or to choose the finish 
connection for a simple integration. 
 
.Procedure
 
. On the *Add to Integration* page, click the plus sign where you 
want to add the connection. Skip this step if {prodname} is
prompting you to choose the finish connection.  
. Click the Gmail connection that you want to use
to send an email. 

. On the *Choose an action* page, select *Send Email*. 
. On the *Configure Send Email* page, do one of the following:
+
* Leave all fields blank if you plan to add a data mapper step
just before this connection and you plan to map integration data 
to the *Send Email* fields.

* Enter information in one or more of the following *Send Email* fields. 
Separate multiple email addresses with a comma. 

.. *Email To*
.. *Email Subject* 
.. *Email Text*
.. *Email cc*
.. *Email bcc* 

* Leave some fields blank and enter information in some fields. 
+
If you plan to add a data mapper step just before this Gmail connection,
and you want to map integration data to some email fields, leave those fields
blank in the action configuration. Enter values in other action fields as needed. 
+
A value that you specify in a *Send Email* action configuration field
has precedence over a value that is mapped from a previous step. 

. Click *Next* to add the connection to the flow. 

.Result
The connection appears in the integration flow where you added it. 

.Next step
If you plan to add a data mapper step
before this connection, first add any other connections that you plan to add
to this flow. Then add the data mapper step. 
