Email Img Body

Hi all!

I have a path for screenshot image. I want to use it for email body. I added to path on html like this:

 "<img src=E:\...\deneme.png width=460 height=345>"

But when the email arrived,

How to fix this issue? How to change my html code?

Hi @Betul_Dundar

You can convert the image into a Base64 component & then send it in the email body. You can refer to the following resource for the same:

Hope this helps,
Best Regards.

Hi @Betul_Dundar,

When you attach an image and send it using SMTP Mail Activity ,the image gets blocked by mailboxes like GMAIL.
This is a known error.
To overcome this, you can use the new Use GMail workspace Send Mail activity to add your image and the image will not be blocked.
Hope this helps.

Regards,
Geetishree Rao

Hello @Betul_Dundar

Invoke Method:
TargetObject: mailMessage.Attachments
MethodName: Add
Parameters: “E:.…\deneme.png”, “image/png”, “inline”, “image1”

Assign:
mailMessage.IsBodyHtml = True

Assign:
mailMessage.Body = “

Send Outlook Mail Message:
Specify mailMessage and other details

Thanks & Cheers!!!

Dear @Betul_Dundar,

Try to keep your image source file in the main project folder instead in subfolders or somewhere.

Thanks and Regards,
Manoj V

I suspect the main issue is you reference a file on the E drive.
The image is not uploaded to the email, only the link is sent, so on the target machine where the email is recieved if there is no matching file on the E drive then the image won’t display.

Most of the time when an email contains links to images they are hosted online so that anyone receiving it can view it. Hard coding in links to local files just doesn’t work unless you only want the emails internal and can ensure everyone can see the same file and the E drive is mapped consistently.

image

base64String=Convert.ToBase64String(byteArray)
Image2Base64= "<img src=""data:image/png;base64,tobeReplaced"" width=""900"" height=""600"" />"
Image2Base64=Image2Base64.Replace("tobeReplaced",base64String)

Giving to Image2Base64 in mailbody it works!

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