ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Using a batch file to create a hyperlinked png or jpg image.

<< < (3/4) > >>

4wd:
If it includes a hyperlinked image like the email you sent me, then it's HTML body in it, and the test email I sent you is using a encoded PNG image, (even though I forgot to change the jpg to PNG in the code above, Thunderbird handled it OK - it knew what I meant :D ).

So to get this straight: the command file generates a PNG image that it inserted into an otherwise static content email?

Any chance you can send me a complete finished email and tell me which image changes?

Ath:
For converting an image to base64 I used this freeware multi-platform off-line/command-line Base64 De-/Encoder (no connections, just a happy user). It supports output to stdout so redirecting output directly into the message from a batch-file is easy-peasy :up:

4wd:
Yeah, found that one and was going to use it, (my mistake I was going to use this one) ... however, unfortunately Outlook is incredibly anal when it comes to displaying the resulting email sent via the above method.

Whereas, Thunderbird is a bit more flexible and has no problem displaying it inline and hyper-linked, Outlook requires that the image be attached and that you use Content-Dispositionw structure to display it inline correctly ... it can't handle the inline encoded image data.

I really, really hate HTML emails.

But we have to cater for the LCD.

However, I think I've found a Powershell script that can send an email using XSL templates, so it should just be a matter of creating an HTML template, addressing, and specifying image attachments ... hopefully.

BTW, for Base64 encoding you can also use the Windows command certutil, (unfortunately it sticks a header and footer on the output).

4wd:
FWIW, the command line utility Blat is able to create and send HTML emails with embedded images.

Just create your HTML email source using <img src="cid:image-name"> tags and then use -embed to attach the images.

eg.

--- Code: Text ---blat.exe -to [email protected] -subject "Embedded images" -bodyF "test_email.html" -html -embed "Top.jpg","Middle.png","Footer.png"
SMTP server info, (missing in above), can be specified in command line or saved to registry so it need not be entered every time.

Only downside is Blat can't handle secure server connection but you could get around that by the extra step of using stunnel.

questorfla:
Thanks 4WD.  PROBLEM  OFFICIALLY SOLVED!  Coming from someone who doesn't even use Outlook :) I would say you did one heck of a job! :Thmbsup:

I had gathered a bunch of various utilities but had not figured out how to run them  Thanks Very much for the info!  I got your email and it worked!  :)

PS:  I thought Blat was a Beer Brand?  Doesn't Homer Simpson drink it?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version