Reply to Gmail specific mail

Hello, recently I was working looping through each email from Gmail with search string. Now, I’m in a problem to reply to a particular mail. I’m not able to figure it out to define Reply To address.

I’ve defined each mail as ‘gmail’. To get To address as replyTo = gmail.From.Address as this is a string variable but activity accepts only Array.

Has anyone worked on this or any idea. Let’s crack this.
image image image

Hey,

the recipients field in the Send Email activity in the Gmail Activites accepts only array!
Give it an array like this:
{"test1@gmail.com","test2@gmail.com"}

Of course, enter your variables as needed.

Cheers, Lukas

You are right but here the challenge you need to reply to that particular mail by using the From address. It is reply to chain mail.

I don’t understand the problem. You had the part about the particular From address already figured out.

Can’t you use the array like this?
{gmail.From.Address}

Cheers, Lukas

Hi @lukasziebold,

What he means is he wants to reply in the same email chain.

In your case, it will, yes, send to the from address, but it will be sent as a new email.

Regards,
Karnik

1 Like

Hi @karnik,

hmmm, I understand. I’m not too familiar with the Gmail activities, but on first sight, I can’t see a good way to reply/forward an email.

Edit: What you can try to do, but this gets complicated fast, is:

  1. Compose your default email body as HTML and use variables for placeholders
  2. Grab the body of your email as HTML
  3. Compose a new email body as HTML where you concatenate the email body you want to reply to with your default email body with values for placeholeders
  4. You should now have an HTML body that looks like you are replying to that email. Adjust your subject like "Re: " + mail.Subject
  5. Try various test emails and see if your concatenated email body works and looks like a reply :wink:

With regular mail activities like the Send SMTP Mail Message activity, there is a property called “Forward”, where you can use your current MailMessage object to reply to or forward it :slight_smile:

grafik

Cheers, Lukas

1 Like

Hello @lukasziebold, you are super. The only stuck was solving the To address. Now we can with UiPath GSuite - Gmail acitivity we can search for any specific mail by Sender, Subject etc. also can reply to that same mail chain. I’ll share the complete solution on Go!. Thank you.

2 Likes

Nice, well done - you’re welcome :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.