Embedded Image on Outlook MailBody shows Broken Link

amisagi

New Member
Joined
Apr 24, 2015
Messages
15
Hi Folks, back after a long time. I am hoping someone can help me with this...

I have a VBA script which will send out emails from excel. It had two images and one table embedded on the mail body Plus a pdf attachment with the entire thing (two images and one table) On outlook (that's what is used in my org) the images and table show up perfect. Problem starts when we view the same mail on phone. I have checked different phones, different OS. Problem is the same: the image shows as a broken link.

I dont want to use the entire information as a table since the quality does not come out good.
I simplified it, and made it one single image. No Go.
I added a line to save the email before display, now it will display a broken link image placeholder, followed by the embedded image as it should be. Mail on outlook still comes fine as expected.
How do i get rid of the broken link image placeholder?

I hope i was able to explain...
Here is the part where i am have the code for the mail body...

Many thanks in advance!

Code:
Dim MailBodyrng As Range
Dim OutApp As Object
Dim OutMail As Object
Dim limits As String
Dim BodyHtml As String


Application.EnableEvents = False
Application.ScreenUpdating = False


Sheets("MailBody").Select


lastrow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row


Set MailBodyrng = Sheets("MailBody").Range("B2:P" & lastrow)


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)


stSender = Sheets("ForEmail").Range("C2").Value
stRecipient = Sheets("ForEmail").Range("C3").Value


If Sheets("MailBody").Range("T8").Value = "" Then
    stCCRecipient = Sheets("ForEmail").Range("C4").Value
Else
    stCCRecipient = Sheets("ForEmail").Range("D4").Value
End If




stBCCRecipient = Sheets("ForEmail").Range("C5").Value
stSubject = Sheets("ForEmail").Range("C6").Value
stAttachment = CreateAttachment & ".pdf"


With OutMail
'    .From = stSender
    .To = stRecipient
    .CC = stCCRecipient
    .BCC = stBCCRecipient
    .Subject = stSubject
    
    'Main Notification - Image on Mailbody
[QUOTE]'    .Attachments.Add Environ("temp") & "\TmpImg1.jpeg" ', olByValue, 0
    .HTMLBody = "<Div align ='center'<\Div>"
'    .HTMLBody = .HTMLBody & "<br><img src='cid:TmpImg1.jpeg' align='center'><br>"
    
'IC & Bridge Details - Table on Mailbody
'    .HTMLBody = .HTMLBody & "<table><tr><td align = 'center'>" & RangetoHTML(MailBodyrng) & _
'                                        "</td></tr></table>"
    
    
    'Chronology Details - Image on Mailbody
    .Attachments.Add Environ("temp") & "\TmpImg2.jpeg" ', olByValue, 0
.HTMLBody = .HTMLBody & "<img src='cid:TmpImg2.jpeg' align='center'><br><br>"
[/QUOTE]    
    
    
    .Attachments.Add (stAttachment) ' Adding attachment as pdf
    .Save
    .Display
    .send
    
End With


Kill stAttachment
Kill Environ("temp") & "\TmpImg*"


Set OutMail = Nothing
Set OutApp = Nothing


Application.EnableEvents = True
Application.ScreenUpdating = True


[SIZE=1][/SIZE]
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top