Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

attaching file to email

Explorer ,
May 12, 2008 May 12, 2008
i have a form that i require an individual to upload a file with. however, i am not putting the attachment in a db, i need it to simply attach to an html email message. i tried using:
<cfif DirectoryExists( ExpandPath( ".\ResumeFolder\" ) )>
<cffile action="upload"
fileField="resume"
destination="#GetTempDirectory()#"
nameconflict="makeunique"
accept="text/plain,application/msword,application/pdf,application/rtf">
Cover Letter/Resume/Writing Sample: <cfmailparam file="#resume#" />
<cfelse>
<cfdirectory directory="#ExpandPath( ".\ResumeFolder\" )#" action="create">
<cffile action="upload"
fileField="resume"
destination="#GetTempDirectory()#"
nameconflict="makeunique"
accept="text/plain,application/msword,application/pdf,application/rtf">
Cover Letter/Resume/Writing Sample: <cfmailparam file="#resume#" />
</cfif>

however, sometimes the emails will be received on mac computers, sometimes on pc's. i need a method that will not require an absolute path to a folder on the hard drive. is it possible to simply attach a document to an email alone?
TOPICS
Advanced techniques
370
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2008 May 12, 2008
check cfmailparam tag in the docs.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008
LATEST
quote:

Originally posted by: sirtcarlos
i have a form that i require an individual to upload a file with. however, i am not putting the attachment in a db, i need it to simply attach to an html email message. i tried using:
<cfif DirectoryExists( ExpandPath( ".\ResumeFolder\" ) )>
<cffile action="upload"
fileField="resume"
destination="#GetTempDirectory()#"
nameconflict="makeunique"
accept="text/plain,application/msword,application/pdf,application/rtf">
Cover Letter/Resume/Writing Sample: <cfmailparam file="#resume#" />
<cfelse>
<cfdirectory directory="#ExpandPath( ".\ResumeFolder\" )#" action="create">
<cffile action="upload"
fileField="resume"
destination="#GetTempDirectory()#"
nameconflict="makeunique"
accept="text/plain,application/msword,application/pdf,application/rtf">
Cover Letter/Resume/Writing Sample: <cfmailparam file="#resume#" />
</cfif>

however, sometimes the emails will be received on mac computers, sometimes on pc's. i need a method that will not require an absolute path to a folder on the hard drive. is it possible to simply attach a document to an email alone?

It doesn't matter what type of computer your mail recipients are using. All the directory stuff applies to your server.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources