Author: Ritendra Dhakciya
This blog provides information about how we can send an email using Mule 4 via Gmail integration.
First we need to add a listener in mule flow
Step 1: Configure Listener Configuration
Then give a suitable method for a resource.
Step 2: Add email connector in working space and drag send email activity in mule canvas
Step 3: Configure email connector
Username: This is the Gmail id that you want to configure SMTP details for
Password: For this, we need to generate a google token. Follow the below steps to help you generate a token:
- Enable Gmail 2-step verification:
- Access https://security.google.com/settings/security/apppasswords, try to generate an App password.
3. Select ‘Mail’ in app list, then select preferred device in list and generate token.
Paste token generated in password.
4. On your Mule Application, define a SMTP config. Go to ‘Advanced’ tab in configuration.
In properties select edit inline and set value as below:
Step 4: In mail activity give the below
- To address
- From address
Step 5: Build and deploy application
Step 6: Test the application.
Hit listener with url.
Check Mail Box: