How to use SMTP for multiple emails

Hey everyone, I want to send mail from 100 different emails account, in SMTP we need to set the apps password for SMTP. So is there any other way I can send mail from 100 different emails?

I am attaching the screenshot for the understanding of my problem.
multiple emails

Hi @Muhammad_Anas_Baloch

You can configure and use multiple SMTP servers to send emails from all 10 email accounts.

Also, many email providers offer APIs that allow you to programmatically send emails from different email accounts without needing to configure SMTP settings.

1 Like

Thank you for your reply. Just FYI, I have 100 email accounts not the 10. So, I cannot configure 100 SMTP servers. Is there any other way to do so?

Can you send any short tutorial or elaborate your 2nd point a bit more, please.

You can follow these steps-

  1. Create a list or an array of email accounts that you want to send emails from.
    You can store the email account information, such as the SMTP server, port, username, password, etc., in a data table, an Excel sheet, or any other suitable data structure.
  2. Use a loop, such as a “For Each” loop to iterate through the list of email accounts.
  3. Within the loop, configure the SMTP settings for each email account using the corresponding values from your data structure. You can use the “Send SMTP Mail Message” activity in UiPath to send emails using SMTP.
  4. Compose the email message with the desired subject, body, recipients, and attachments.
  5. Finally, use the “Send SMTP Mail Message” activity to send the email using the SMTP settings configured for the current email account in the loop.


1 Like


Also, as example taken from Gmail as below you can add e-mail address under one gmail account

Hope this may help you


1 Like

Hi @Muhammad_Anas_Baloch - Instead of configuring 100 different mail accounts, can you try maintaining all those mail ids in a config file separated with comma. Within your code, you can use the below one to get the each mail ID

Variable of type Array Of Strings Output=Input.Split(","c).ToArray

Use For Each loop, to send an email from each mail id

1 Like

Dear I totally understand your point but the issue is that SMTP doesn’t supports the normal password of the email. We have to create apps password. So it would be so hectic for me to create 100 emails apps password.

You’re idea could be a solution if SMTP supports the normal password :slightly_smiling_face:

Let me explore this. Thank you :slightly_smiling_face:

But as I replied earlier to @Nitya1 the issue is that SMTP doesn’t support the normal email password we must have to create the apps password for the authentication purpose so it wouldn’t be an easy task for me to create apps password for 100 mails. I hope you’re getting me.

@Nitya1 @ushu I get this error which is because of using the simple mail password and not the apps generated password.

Hi ,

Try this API approach-

  1. Identify the email service provider that you want to use for sending emails via API which include Gmail, Outlook/Office 365
  2. Register and obtain the API credentials (e.g., API keys, access tokens) from the chosen ESP.
  3. Create a UiPath workflow that includes the necessary activities to send an email. This typically includes activities such as “Send SMTP Mail Message” or “Send Exchange Mail Message,”
  4. Configure the email activity in UiPath to use the API credentials obtained from the ESP. This may involve setting properties such as the SMTP server address, port number, authentication type, username, password, API key, or access token.
  5. Repeat the above steps for each of the 100 different email accounts that you want to send emails from. You may need to store the API credentials for each account securely, such as in a password manager or a secure database, and retrieve them dynamically in your UiPath workflow.
  6. Iterate through the list of email accounts and call the email sending workflow for each account using a loop or other control flow activities in UiPath. This will allow you to send emails from multiple accounts sequentially or concurrently, depending on your requirements.


1 Like

In step 5 it still says create API for 100 different email accounts. :slightly_smiling_face: