Embedded image in email appears Blank

SydneyBuoy

New Member
Joined
Sep 9, 2019
Messages
4
Unable to understand why image is not showing in the signature of the email. I have checked the image exists, the folder path is fine. The image is showing up as a dotted frame on the last line of the email. Any help would be appreciated.

Function S0N1(fldName As String, Optional FileType As String = "*.*")

Dim fName, StndrdfName, ImgPath As String
Dim sAttName, xMsg As String

Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem
Dim olAtt, As Outlook.Attachments

Set olApp = Outlook.Application
Set olMsg = olApp.CreateItem(0) ' email
Set olAtt = olMsg.Attachments

NonStandFolder = Sheets("Bookmarks").Range("Bookmark9").Value
NonStandTemp = Sheets("Bookmarks").Range("Bookmark13").Value

FileType = NonStandTemp & ".pdf"
fName = Dir(fldName & FileType)

Do While Len(fName) > 0
olAtt.Add fldName & fName
sAttName = fName & "<br /> " & sAttName
Debug.Print fName
fName = Dir
Loop
'***************************** Path for Signature Image **********************************
ImgPath = Sheets("Email Setup").Range("Logo_Path").Value
'******************************************************* Main Email Message **************************************************************************************
xMsg = "<HTML><BODY>"
xMsg = Sheets("EmailText1").Range("EM1_L1").Value & "<br>"
xMsg = xMsg & vbNewLine & Sheets("EmailText1").Range("EM1_L2").Value & "<br>"
xMsg = xMsg & Sheets("EmailText1").Range("EM1_L3").Value & "<br>"
xMsg = xMsg & "</BODY></HTML>"

AttchFile = NonStandFolder & "\" & NonStandTemp & ".pdf"
'******************************************************* Email Details with Non Standard Attachement *******************************************************************************************
With olMsg
.Subject = Sheets("Bookmarks").Range("Bookmark14").Value
.To = Sheets("Bookmarks").Range("Bookmark3").Value
.CC = Sheets("Bookmarks").Range("Bookmark7").Value
.Attachments.Add AttchFile
.Attachments.Add ImgPath, oByValue, 0
.HTMLBody = xMsg & "<br>" & _
"<img src='" & ImgPath & "' height=50 width=100>" & .HTMLBody
.SentOnBehalfOfName = Sheets("Email Setup").Range("Bookmark15").Value
.Display
.Send
End With

Set olAtt = Nothing
Set olMsg= Nothing
Set olApp = Nothing


End Function
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Resolved. Replaced units in height and width.

Replaced "<img src='" & ImgPath & "' height=15% width=15% >" & .HTMLBody
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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