Embedding Image in email using MS Outlook VBO

I am trying to attach image in the body of mail using below mentioned html code. However the image is not visible(broken/corrupted) in the receiver side.

"<p style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;text-autospace:none'><img width=895 height=118 id='Picture_x0020_2'
src='file:///"&[Image Path]&"'><o:p></o:p></p>"

Could anyone able to help me?


@VJR
 

Attachments

  • Received Image(Broken).PNG
    4.1 KB · Views: 77

Sachin_Kharmale

Active Member
Hi ,
If you want to embedding image in mail body then you can so with the Outlook, Just do the following steps.

your input image we need Input image path-
View attachment 1575972203195.png
Step 1- Copy your input image to System Clipboard.
View attachment 1575972244140.png
Step 2- Design Code stage to send image in mail body with the following code.
View attachment 1575972262922.png
Step 3- Execute code /flow and see you have get image in mail body or not.

View attachment 1575972319756.png

I hope it will help you..!
 

Sachin_Kharmale

Active Member
Hey

Try to use following namespaces in your Init Page
View attachment 1576044132114.png


2. Use bellow VB.net Code in Code Stage.

C#:
Dim oApp As New Outlook.Application
Dim msg As Outlook.MailItem
Dim myInspector As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
msg=oApp.CreateItem(0)
With msg
        .BodyFormat = 2
        .To = MailTo
        .CC = MailCC
        .BCC = MailBCC
        .Body= MailBody
        .Subject = MailSubject
        myInspector = .GetInspector
        wdDoc = myInspector.WordEditor
        'wdDoc.Content="Hello Good Morning"
        oRng = wdDoc.Range
        'oRng.collapse=1
        oRng.Paste
       
       
        .Display
       
End With
msg.send
]

Note- Make Sure you have Image in Clipboard.

I hope it will help you,,
[/CODE]
 

anudeepsura

New Member
Hi,
Sachin, when I am using above code image body is embedding in email body but when I am writing any message in email body it is not showing can u please help me out from this
 

MadhuG001

Member
Hi ,
If you want to embedding image in mail body then you can so with the Outlook, Just do the following steps.


your input image we need Input image path-
View attachment 4924
Step 1- Copy your input image to System Clipboard.
View attachment 4925
Step 2- Design Code stage to send image in mail body with the following code.
View attachment 4926

Step 3- Execute code /flow and see you have get image in mail body or not.

View attachment 4927

I hope it will help you..!
Hi Sachin,

Which VBO you are using inside "Set Input Image to clipeboard"?
Thank you.
 
Top