In this example, we will use, besides the Email Connector:
A Scheduler component, that will trigger the flow execution.
A setPayload component, that sets the message content we will send to the email Addresses.
A property file that will contain the email Addresses this file needs to be placed the project's src/main/resources folder
First you need to configure property to be used for use in Mule app
<configuration-properties doc:name="Configuration properties" doc:id="84071604-43ac-4917-9904-b5a1331ecc74" file="application.properties" doc:id="84071604-43ac-4917-9904-b5a1331ecc74"/>
The email connector only need to be pointed to the property that contains the email addresses. The easiest way to achieve this is configuring the addresses as an expression.
Using the p function to point to the property that contains the emails, and since the addresses are comma separated, we will user the splitBy function, this will split these values into an array of separate elements.
<email:send doc:name="Send" fromAddress="test.mule.imaps@gmail.com" config-ref="Email_SMTP" subject="Hello World Subject" toAddresses="#[p('emails')splitBy(",")]">
</email:send>
More details on the functions used can be found in our documentation:
https://docs.mulesoft.com/dataweave/latest/dw-mule-functions-p
001114454

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.