This may be answered somewhere but everything I have tried fails at the point of use.I have a batch file that performs various functions and i the final steps creates a link to a page on a website that is output as a text file along with a image file named "invitation.png". Once completed, I have to open Outlook, start a new email, paste in the 'invitation.png', right click it, choose add hyper-link, then paste in the hyper-link from the text file. This works perfectly ... but is tedious when done often per day.

Being a big fan of automation and having a working batch file that already creates all the necessary parts, I am looking for a way to combine the final "done by hand" part. But apparently automating the insertion of a hyper-link into an image file which is then sent via an email is beyond anything I can follow. I tried most methods I could come up with but did not get any that worked.

Given that I have the necessary parts, is there a scripting maneuver to get this hyper-link embedded into the png file and put the whole thing into the body of an email ready to send?

If Outlook is required, you better use PowerShell, which is more powerful and can access applications & servers installed on your system in ways batch scripts cannot even dream of. But if that isn't the case, you could use batch script in combination with a command-line mailer (3rd party or what is included with Windows) and push out the messages that way. With batch scripts it is usually best to keep things as simple as possible.

There are even SMTP servers you run from the command line on your computer...but use those at your own peril. You don't want your IP address being blocked by organizations that patrol the internet for spammers.

Maintaining your own mail server is a job not for the faint of heart, because there are so many ways of doing it wrong. Better use the mail services provided by your ISP or mail host. A command-line mailer can send mail through those services without problems, provided you use ports that aren't blocked. Most ISP's block port 25 by default to prevent unsanctioned SMTP traffic (a.k.a spam).

Find out how Outlook is sending your mail now (SMTP/IMAP/Exchange/whatever) and find a command-line mailer that can do the same. Use the settings from Outlook with the command-line mailer and you should be able to send mail just like Outlook does, only without Outlook. From here it should be relatively easy, as you already have the rest of the "building blocks".

Thanks shade. Mailto is the function use to get outlook to open a new email. It works very well. But getting the image into the opened email is going to be either AHK or ???I have looked ever where for a command to grab a file and put it in the mail. It is SO easy to do copy and paste or any number of screen capture programs leave exactly what i need onthe windows clipboard where a paste command is all it takes.This is a straight up Window setup MS Outlook and all. I know what needs to be done but am short on the "how to do it" department.

Once I get the image into the email then i think i am in unknown territory needing to use VBA scripting to manipulate items in an email which will probably kill the whole thing. Once upon a time, you could simply embed hyper-links in images anyway but the only ones that can do that now (as fas as know) are "favicon.ico" filesMaybe there is a way I can copy the favico.ico file into the email but not sure it would even function as a web-link if done that way? Never tried that.

This is one of those exercises in effort that probably are not worth anything other than to find out if it can be done?

A few canges to some places got me very close this actuallty does work believe it or not. the strikeout needs t be chaged out coursethe subject etc easy to see how to editthe body is the final hurdle as i want to put there the contents of the clipboard. Atthe time this is run, the image is alrady held inthe clipboard and i normally chose paste to add itso the final part "body=?" to copy contents of clipboard to body. Then the coup de gras would the addition of the hyper-link. If this works I think it would be a recipe for scriptng never before used for anything

I am barely runnig on just the memory of coffee from hours ago. so this may have to sleep for the night

Down to last step if i can make it.Need to activate "control+V" or "paste command" from within the batch file.the deafult paste from location is the clipboard which would have the file needed so if i can run it, the file would insert(ie: paste) right where i want it in the body I can get all the way to the body of he email, everything is done, it is addresses, notations made, subject written as needed, I guess COULD do it as an attachment but that would be be as impressive

I just want t be stubborn about it Thanks for the help getting to here. The setup looks impossibly complex and i never thought it would get this close.

Thanks ATH. I will try this today and let you know but it should work. I searched all over for the windows native function to apply ctrl+v and found nothing. Nor anything to activate Paste from within an email (other than writing a custom Outlook script which i had no idea how to do)

OK, two questions:1) Is the HTML you are sending to these recipients static, (ie. apart from the recipient email address everything is the same - although that's not really a requirement, it could be built on the fly) ?

2) Does it have to go through Outlook, (I mean, do you REALLY have to use Outlook to send it) ?

If the first answer is Yes and the second No then there is a very simple way to achieve what you want using a simple command line program.

Hmm. OK I'm game. If this works I promise I will never doubt your prowess.

Replies to questions:No it does not have to go through Outlook i just need to get it to them via emailHowever, i am afraid there may be a slight issue in that it isn't html, it is an email like i sent you.the png image is in the body of the email I will look for your reply have not looked at email this am yet

The output of the batch is a PNG image. Or could be a jpg i guess but i have not tried embedding hyper-link in jpg )The Manual part is copying the png into an open email and anchoring the hyper-link into it

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 ).

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?

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

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).

According to Max Vasmer, the origin of the word blat is the Yiddish blatt, meaning a "blank note" or a "list".[5] However, according to both Vasmer and N. M. Shansky, blat may also have entered into Russian as the Polish loanword blat, a noun signifying "someone who provides an umbrella" or a "cover".[5] The word became part of Imperial Russian criminal slang in the early 20th century, where it signified relatively minor criminal activity such as petty theft.[5]

``NO real reason for calling it blat... actually I wanted to call it Blat mainly because Pedro thought it was a ridiculous name. And then because we could say things like 'I'm just going to blat off a quick email to ...' etc...''