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!
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: