Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mfasis #1
Adding attachments to cfmail
I have a form that allows a user to send an email to a list with the option of
adding an attachment. The action page uploads the file, using cffile, to a temp
diectory and then creates the email and adds the attachment using cfmail and
cfmailparam. I then used cffile to delete the file. A problem arose because the
file was deleted before the email was sent. I then used the following code to
delete all files in the temp directory before uploading the new file.
<cfdirectory
directory='#REQUEST.Site_DirectoryPath#brd_dynamic/email/attachments/'
name='q'> <cfoutput query='q'> <cfif q.type eq 'file' and dateDiff('h',
createodbcdate(q.datelastmodified), now()) GT 0> <cffile action='delete'
file='#REQUEST.Site_DirectoryPath#brd_dynamic/email/attachments/#q.name#'>
</cfif> </cfoutput> I get the following error: The value 'Thursday, March
24, 2005 2:40:33 PM EST' could not be converted to a date. Any ideas?
mfasis Guest
-
CFMAIL - Unicode filename for attachments
Hello again PaulH, I am hoping you can give me some advice about this. I have the charset attribute set to "utf-8". See attached code. I've... -
Dynamically Including CFMAIL Attachments
Please help! I am wrting an app that uses CFMAIL, and need to dynamically attach files based on locations and filenames stored in a table. I... -
Adding Multiple Attachments to CFMAIL
Is there a way to add multiple mime files using <CFMAIL>? Here is the code I am using, but it doesn't work. When I comment out the second mime... -
2 attachments in CFMail
I think the summary says it all. Anyone know the syntax for this? Assuming it is possible of course :-) -
cfmail - Attribute validation error for tag CFMAIL.
I'm getting the error ' Attribute validation error for tag CFMAIL.' on the code below. All its doing is outputting a text string to the TO: field. ... -
blewis #2
Re: Adding attachments to cfmail
You probably want to get rid of the createodbcdate() call in there.
blewis Guest
-
mfasis #3
Re: Adding attachments to cfmail
Sorry, In my original code the creatodbcdate() was not there. I was just
trying anything to see if it worked. <cfoutput query='q'> <cfif q.type eq
'file' and dateDiff('h', q.datelastmodified, now()) GT 0> <cffile
action='delete'
file='#REQUEST.Site_DirectoryPath#brd_dynamic/email/attachments/#q.name#'>
</cfif> </cfoutput>
mfasis Guest
-
Mike Greider #4
Re: Adding attachments to cfmail
Are you using CF 7? This seems to run just fine for me on CF 6.1. Although I
did hard code my path instead of using a variable. You may want to try that
just to see if they might be something wrong with the variables.
Mike Greider Guest
-
zoeski80 #5
Re: Adding attachments to cfmail
Hi
Try using ParseDateTime, it will convert to standard Date/Time format so you can do the date comparison.
#dateDiff("h", ParseDateTime(q.datelastmodified), now()) #
HTH
Zoe
zoeski80 Guest



Reply With Quote

