We help IT Professionals succeed at work.

Trouble With CFMAILPARAM and FILE attribute

timonline
timonline asked
on
402 Views
Last Modified: 2013-12-24
With <CFMAILPARAM> I can embed an image in an email when the File attribute is pointing to a local path, such as C:\wwwroot\abc\images\theimage.gif. The ContentID, disposition and type attributes all seem OK. But when I try to do the same thing and refer to a system path on a remote server I get an Unknown Attribute error. It must have something to do with the path but I can't work out what the problem is. My best guess was File="http://www.domainname.com/images/theimage.gif" but that doesn't work. Anybody out there that can help?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
when you say remote server do you mean on the local network?

If so it is due to the cfservice not having permissions to that folder. By default CF runs as local system which does not have any access to network shares and drives.

You need to create a domain user called cfservice (or whatever),  then on the machine which is running cf, go to admin tools > services right click/properties on cf App Server logon tab log on as cfservice and password ok restart service

go to net folder and assign read and write if desired (for cffile)  permissions to cfservice

if you are trying to access a web address...you can't. You would need to use cfhttp to grab the image and then use that. cfmailparam needs an absolute path

Author

Commented:
SidFishes, thankyou...
Can I confirm one thing...You can't access a web address such as http://www.domain.com/images/theimage.gif in order to grab an image and embed it into an email using <CFMAILPARAM>? If so, how could I achieve this? I simply want to embed an image into an email 'on the fly' when a visitor registers on my website.
CERTIFIED EXPERT

Commented:
can you not just store the file locally?
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
err

  path="c:\temp\"
  file="theimage.gif">
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.