user2569524
user2569524

Reputation: 1751

Html Images dont render in outlook email via Blat

I trying to send the following HTML page as an email using the command line tool blat.

Email is sent as expected but, the images are not loaded in the email message.The email content looks like :

enter image description here

<html>  
      <body>

        <style>
          .img2{

          height: 800px;
          max-height: 700px;
          background-size: 100% 100%;

        }
        </style>


          <div class="container">
           <div class="row" >
              <div class="col-md-6 col-sm-3" >
               <img class='img2' src="cid:image1.png"/>
              </div>
                <div class="col-md-6 col-sm-3">
                 <img class='img2' src='image2.png'>
              </div>

              </div>

            <div class="row">
                  <div class="col-md-12 col-sm-6">
                 <img class='img2' src="D:\reports\image3.png"/>
              </div>
               </div>  
         </div>
        </body>
    </html>

I have tried using 'cid' before the source path but in that case web page itself does not load the images as the path is resolved incorrectly.

Blat command used : blat "D:\reports\mail_send_2.html" -t [email protected] -s "email subject" -embed "D:\reports\image1.png" -embed "D:\reports\image2.png" -embed "D:\reports\image3.png" -html

Could some one help me out here . Thanks !

Upvotes: 0

Views: 1224

Answers (2)

David P
David P

Reputation: 2083

Have you viewed the source of the email to see if your cid matches?

In addition, one thing you should know is that you shouldn't use classes in your HTML for email. Not all email clients recognize it. Instead you should mark each HTML element with a style="" tag, and explicitly set CSS attributes. Kind of a pain, but...

Upvotes: 1

user2569524
user2569524

Reputation: 1751

Placed the images in the same folder as the Html page and then using cid and embed together worked as expected.

Upvotes: 1

Related Questions