You did not say how you are placing the image into the email. Are you using <cfmail> for example? Or, are you talking about a HTML email sent with a client such as Outlook? Please let us know.
I agree that would help.
Attaching via CFmail will not be a problem at all.
I would like to atach it to the likes of outlook and kmail signatures.
So that when i send an email from kmail it will attach a random image to the mail.
I hope that helps
If your IMG tag always shows an image, then any HTML email sent via CFMAIL should work fine, BUT (and it's a big BUT) you have no control over the client who receives the email. They may refuse HTML emails, or they may block IMG tags (for privacy concerns). When you said "However this does not work" what did you mean? Please explain.
Creating a HTTP connection from the email to the image is also undesirable. It's probably better to embed the image, like this using a "data:" URL:
<cfset ImgFile = "d:\somefolder\images\myimage.png">
<cfset ImgHeader = "image/png;charset=utf-8;base64">
<cfset ImgData = ToBase64(FileReadBinary(ImgFile), "utf-8")>
<img src="data:#ImgHeader#,#ImgData#" alt="sig">
The data: URL includes the actual image within the IMG tag, so no outbound HTTP request to the image is required.
OK it does work.
I gathered kmail would show me the image inline when i say new.
but if i hit send the receiver does get the image.
Thanks very much for yu r help. but it seems it was working all the time
I find the best approach isto use the embedded image code above. That gets the image in most email clients, e.g. Outlook etc. Remember too that just because you can see the image, it does not mean others definitively can Test it in Gmail, Hotmail and Outlook etc and see what results you get.