Re: how to embed images inside an email.
| Newsgroups | gmane.mail.blat |
|---|---|
| Message-ID | <165D86D1B7834B68A3343F5079C953E4@chip> |
> Hi Chip, > > Thanks for the explanation on how to have the jpg image in the body of the email instead of an attachment > > Below is a simple short batch file that runs my small project: > > blat -install 127.0.0.1:25 [email protected] 1 - - ***** ***** > rsamalert_man > rem blat rsam_alert_man.txt -attach man1minrsam.jpg -s "MAN RSAM ALERT" -log log.txt -to [email protected] > blat rsam_alert_man.txt -attach man1minrsam.jpg -html <img src="cid:man1minrsam.jpg"> -s "MAN RSAM ALERT" -log log.txt -debug -to [email protected] > del rsam_alert_man.txt > > Line 2 (rsamalert_man) is a program that processes input data and produces; > > - rsam_alert_man.txt > - man1minrsam.jpg > > I added the -html line in Line 4 and it is not passing the test. It gives the message, "The system cannot find the file specified". The jpg file is in the folder where the batch file runs. I suspect its not passing the test because the syntax for the -html is not correct. Would you be able to help again on this. > > Thank you. > > Ima. Ima, When sending emails to the Blat group, please remove or edit any userid and passwords that might be included. The actual line of html for including the image needs to be within the message file itself. In other words, the content of your message file must be html. Below is the actual test file I use in testing, named nfl_logos.htm: --------------------------- <html> <body> <p>To use the following logos and names, just copy and paste into future emails with your picks.<br> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTBPlNA96dvYrDb9V10t9xPWvghVwPtCO1MvDDyMFEtHYcorgSKf13GAhk" width="53.5" height="45"></p> <br> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/ari.png" width="75" height="75"> Arizona Cardinals</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/atl.png" width="75" height="75"> Atlanta Falcons</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/bal.png" width="75" height="75"> Baltimore Ravens</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/buf.png" width="75" height="75"> Buffalo Bills</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/car.png" width="75" height="75"> Carolina Panthers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/chi.png" width="75" height="75"> Chicago Bears</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/cin.png" width="75" height="75"> Cincinnati Bengals</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/cle.png" width="75" height="75"> Cleveland Browns</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/dal.png" width="75" height="75"> Dallas Cowboys</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/den.png" width="75" height="75"> Denver Broncos</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/det.png" width="75" height="75"> Detroit Lions</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/gb.png" width="75" height="75"> Green Bay Packers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/hou.png" width="75" height="75"> Houston Texans</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/ind.png" width="75" height="75"> Indinapolis Colts</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/jax.png" width="75" height="75"> Jacksonville Jaguars</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/kc.png" width="75" height="75"> Kansas City Chiefs</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/mia.png" width="75" height="75"> Miami Dolphins</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/min.png" width="75" height="75"> Minnesota Vikings</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/ne.png" width="75" height="75"> New England Patriots</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/no.png" width="75" height="75"> New Orleans Saints</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/nyg.png" width="75" height="75"> New York Giants</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/nyj.png" width="75" height="75"> New York Jets</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/oak.png" width="75" height="75"> Oakland Raiders</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/phi.png" width="75" height="75"> Philadelphia Eagles</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/pit.png" width="75" height="75"> Pittsburgh Steelers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/sd.png" width="75" height="75"> San Diego Chargers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/sea.png" width="75" height="75"> Seattle Seahawks</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/sf.png" width="75" height="75"> San Francisco 49ers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/stl.png" width="75" height="75"> St Louis Rams</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/tb.png" width="75" height="75"> Tampa Bay Buccaneers</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/ten.png" width="75" height="75"> Tennessee Titans</p> <p><img src="http://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/wsh.png" width="75" height="75"> Washington Redskins</p> <p><img src="cid:embeddedImage1.jpg"> Test for embedded image</p> </body> </html> --------------------------- Very near the bottom of my file shown above is the cid: tag that tells the html renderer to look for an embedded image within the email, and what that image name is. My command line to send that file is this: x64\Release\blat.exe ..\Test_Files\nfl_logos.htm -embed "..\Test_Files\embeddedImage1.jpg" -to myself -s "Testing embedded images" -p smtp4dev -log R:\blat.log I do not need the –html option because the message filename (..\Test_Files\nfl_logos.htm) already has .htm extension, which Blat uses to look for the content type in Windows registry. Chip --- This email has been checked for viruses by AVG. http://www.avg.com