Sending Mail with image in the body

Hi everyone,
My process is to read the mail from draft and pick “to field” from excel and send mail

but if draft mail has image or any hyperlink how to handle this

i have tried with “ishtml” property but the image is not coming complete

After “ishtml” the content is “<div dir=“ltr”>Hi Sir,


Have a nice day.
<img data-surl=“cid:ii_kuhvuyie0” src=“cid:ii_kuhvuyie0” alt=“image.png” width=“473” height=“266”>


Thanks and Regards,
Supriya Yenaganti
\r\n”

Thanks and Regards,
Supriya

Dear Supriya,
Could you please try the steps as mentioned in the below link for embedding images in email:

Send Embedded Images in an Email - News / Knowledge Base - UiPath Community Forum

Thanks,
Geetishree Rao

Hi

Have a look on this below threads

Cheers @supu123

Hi @Palaniyappan @geetishree.rao

Input is from draft mail so image will be draft so how would I get the image path or image filename

See the xaml, I hope u will understand

Main.xaml (11.1 KB)

Thanks and Regards,

Supriya Yenaganti

Hi @Palaniyappan @geetishree.rao

Drat mail for reference

Thanks and Regards,
Supriya Yenaganti

So you are getting the input image from draft folder
Am I right

If so use a GET MAIL activity with Draft as folder name and inside the for each loop use save attachment activity and it will save the embedded image as well

@supu123

Hi @Palaniyappan

Yes the image is in the draft mail body which m reading with imap ishtml property enabled and sending the mail with smtp ishtml property enabled

Thanks and Regards,
Supriya

Have updated the previous comment @supu123

Hi @Palaniyappan

If I have attachments in the mail and image in mail body and if I use SAVE ATTACHMENT
how would I know which attachment is in the body of mail

Thanks and Regards,
Supriya

Dear Supriya,

Would suggest the same, save the image attachments inside email using Save attachment activity while looping through the emails and use them accordingly.

You can put a check as well,to see if the mail contains an attachment or not before saving them.

Thanks,
Geetishree Rao

You can save it different folder with that drafted mail subject if being unique
If not
Save it in different folder with timestamp along the folder path

As Saves the mail message attachments to the specified folder. If the folder doesn’t exists, it is created.

So while mention the folder path use a + symbol and mention the cell time stamp or counter variable inside the loop

@supu123

@geetishree.rao

If my body will not have image and mail has attachments
or
if my mail has no attachment and body has image

From the attachments saved using “Save Attachments” how would I differentiate which file is for body and which is for attachments is my question

Thanks and Regards,
Supriya

Then you can check the extensions(extract the attachment extensions after last.),if the extensions are that of an image(.png,jpg,etc) then its an image

@geetishree.rao

If there would a logo in the mail with an image in the mail body then how to handle this

Thanks and Regards,
Supriya

Dear Supriya,
Could you answer below qns to help you out wid the logo query:

1.Are you expecting same logo all the time or it may differ
2.Logo Position
3.Do you want to send the logo as well

Thanks,
Geetishree Rao

Hi @geetishree.rao

  1. logo may differ all the time
    2)sometimes we may have logo sometimes we may not

Thanks and Regards,
Supriya

Do you want to send that as well

Dear Supriya,
Get the email body as HTML and try to analyse the html of emails with and without logo.
Then you can add a condition to check for text/attributes present in html body when logo is present and skip for those attachments

Thanks,
Geetishree Rao