Actually i try to reply email, but if there have images, replied images will error,.
this is my flow:
I get html from body email targeted
i concat string myBodyHTML & obtainedBodyHTML
src image of myBodyHTML is same with src image of obtainedBodyHTML,but error and causes the image not to appear, need to generate src image first i think,
so i want try to get images and save it with bytes then use to myBodyHTML, i dont know its will work or no, but i just want try first… i tried but throw an error, this is my code
To save images from HTML and use them in another HTML body, you can follow these steps in UiPath:
Use the “Get IMAP Mail Messages” activity to retrieve the email with the HTML body.
Extract the HTML body from the email using the “MailMessage.Body” property and store it in a variable (let’s call it emailBody).
Use the “Matches” activity with the pattern <img[^>]*src="([^"]+)"[^>]*> to extract the image URLs from the emailBody. This will give you a collection of matches.
Iterate through the collection of matches using a “For Each” activity.
Within the loop, use the “HTTP Request” activity to download each image file. Set the “Endpoint” property to the URL obtained from the match.
Save the downloaded image file to a local folder using the “Write Binary File” activity. Specify the file path and use the “Content” property of the “HTTP Request” activity as the input.
Replace the image URL in the emailBody with the local path of the downloaded image file.
Use the modified emailBody as the HTML body for the reply email.