HTML Email with Embedded Images from Your Hard Drive
Previous Topic  Next Topic 



This example demonstrates how to send a HTML email with embedded images stored on your local hard drive.


Additional Prerequisites


Using this feature requires working knowledge of creating and editing HTML pages. We have provided an example page here.


Prepared Example Files



The -bodyfile parameter in NetMailBot uses full paths. We have assumed a particular path as shown in the batch file contents below. Therefore, download this file to C:\tmp on your hard drive or edit the -bodyfile parameter to reflect wherever you unzip the archive.


The archive contains three files:



Batch File Contents


This is the content of the batch file:


netmailbot -to -from -subject "Customer Follow-Up" -server localhost -logfile c:\tmp\log.txt -bodyfile "c:\tmp\HTMLEmbedLocalDrive\HTMLEmbedLocalDrive.html" -altbody "To view the contents of this email, please visit our website, at" -embed




  1. Unzip the file. This will produce a directory called "HTMLEmbedLocalDrive". Open this directory.
  2. Refer to HTMLEmbedLocalDrive.html for an example HTML file that shows how to create your HTML page with the images you wish to include in your email.
  3. Save your HTML page and all its images in the same directory. In this example, all of the files should be saved in the C:\tmp\HTMLEmbedLocalDrive" directory, unless you want to edit the -bodyfile parameter to match some other location.
  4. The images should reference the image name and directory name. Open HTMLEmbedLocalDrive.html and note that the image exclamationsoft_logo.gif is referenced as: 


<IMG alt="" src="c:\tmp\HTMLEmbedLocalDrive\exclamationsoft_logo.gif">


The images must include full path information, e.g C:\tmp\HTMLEmbedLocalDrive\exclamationsoft_logo.gif.

  1. The use of the -altbody parameter allows a recipient whose email client cannot display HTML to receive this plain text message as an alternative.
  2. Open Notepad and edit the batch file "HTMLEmbedLocalDrive.bat". Change the values of the parameters -to, -from, and -server to a test recipient of your choosing, your email address, and your mail server.
  3. Invoke the batch file.
  4. NetMailbot should start up and, upon finishing, the email addresse specified with the -to parameter should receive an HTML email message with the ExclamationSoft logo embedded in it.