0

Image of the content that is supposed to be sent from my end.

Image of the content that is supposed to be sent from my end.I had coded in HTML format to add an image in mail body and another one in signature though function. But the problem is it showing perfectly at my end as i am sender of the email but reflecting as Red cross mark like he is not able to find image at the designated path. Can anybody help me out here why it is happening and how to rectify it. I am attaching my code and screenshot of the image received at the other end.

Error email received

Error email received

.HTMLBody = "<font face=""calibri"" style=""font-size:11pt;""> Dear Team," & 
            "<br> <br>" & _
            "<font face=""calibri"" style=""font-size:11pt;""> Please find 
              the attached sheet for Raw Cell Outage of " & Format$(Date, 
              "dd-mmm-yyyy") & _
        "<br><br>" & _
        "<font face=""calibri"" style=""font-size:14pt;""><b> This is based 
           on Raw Outage without validation at field end.<b>  " & _
        "<br><br>" & _
        ***"<img src='C:\Cell Outage Report MACRO\Output Data\AST_img.png'>" &_***
        "<br><br>" & _
        "<font face=""calibri"" style=""font-size:12pt;""><b><u>Thanks & 
         Regards,<b><u>" & _
        "<br>" & _
        "<font face=""calibri"" style=""font-size:15pt;""><b>Team OMC<b>" &_
        "<br>" & _
        "<font face=""calibri"" style=""font-size:15pt;""><b>B&JH<b>" & _
        "<br>" & _
        "<font face=""calibri"" style=""font-size:12pt;""><b>Contact No:- 
           0000000000<b>" & _
        "<br>" & _
        ***"<img src='C:\Cell Outage Report MACRO\Sign_logo.png'>" & _***
 [Image of the mail received at the other end][1] .HTMLBody & "</font>"   ' Adds default signature
Community
  • 1
  • 1
Akshay Kumar
  • 5
  • 1
  • 1
  • 11

1 Answers1

0

You need to attach the image to the mail by using the Attachments.Add Method. This can be done in a hidden manner, so it is not seen as an attachment, but it can still be referenced in HTML type fashion to show the picture within the body. Use the property accessor to set this property. Here is an SO article with good example code.

Another option is to create a mail template (Text, insert images etc.) by displaying/saving a mail object since outlook will do all that work (hidden, HTML reference etc.) for you. Just copy that mail item and adjust it to your needs afterwards.