How to get the To (receiver's) mail id from gmail using imap

Hi all,

How to get the receiver’s mail id from the sent items folder using IMAP.
Tried using this

currentItem.To.ToString

But not able to get the receiver’s mail id’s.
How to do this, please guide me on this.

@lakshmi.mp

try this once

CurrentItem.From.tostring

@Shiva_Nikhil ,
currentItem.From.toString this will give the sender’s address, but here need to take the receiver’s id from sent items folder.
How to do this…

Hi @lakshmi.mp

I Don’t understand your exact requirement but you can try from below.

For Receiver’s Mail: CurrentItem.Headers(“to”) (Try this)

For Sender’s Address: CurrentItem.From.ToString
For Sender’s Name: CurrentItem.From.DisplayName.ToString

Hope this helps you :slight_smile:
Cheers!!

@Nawazish_Ahmad,

For Receiver’s Mail: CurrentItem.Headers(“to”) (Tried this)
It’s not extracting the receiver’s mail id from sent items folder.

@lakshmi.mp

you are already using the receiver maild in the properties of get IMAP

you can store it in a variable and use where you want

1 Like

@Shiva_Nikhil , @Nawazish_Ahmad

currentItem.From.Address

this will give the from (sender) mail id from inbox folder.
image
But now want to extract the receiver’s mail id’s from sent folder
image

@lakshmi.mp

This is my Sent Items (I have sent mail to someone)

You can get both the emails- sender & receiver from below expression

image

@Nawazish_Ahmad ,

currentItem.To.AsText.ToString

=> used this to get receivers id but it’s not fetching
how u did, can u elaborate more on this…

@lakshmi.mp

Okay you are Using IMAP, Previously I have used Get Mail Messages activity with Gsuite Application Scope.

For IMAP

Use the below once for both Sender & Receiver mail id.

currentItem.From.Address.ToString
currentItem.To.AsText.ToString
image

Hope you understand now :sunglasses:

@Nawazish_Ahmad ,
how to use this activity
image
Used this but not able to get the receiver’s mail id
image

@lakshmi.mp

Can you share your code here for this flow.

Sent_mail_IDs.xaml (20.1 KB)
@Nawazish_Ahmad , workflow has been attached. Please look into it.

@lakshmi.mp

I had made some changes.
Sent_mail_IDs.xaml (20.3 KB)

**Assign email address in Email variable and check password also in pwd variable.

1 Like

@Nawazish_Ahmad ,
thanks for the helping. Able to get the receiver’s mail ID…

1 Like

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