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 :
<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 example@domain.com -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 !
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...