• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

CFMail issue with Attachments

I am having problems sending mail with an attachment and just cannot diagnose the problem.

When I send mail without an attachment it works fine. When I remove the attachment code and just include the attachment path:

#trim(request.cfinstdocs)#\#trim(getInstFiles.fileName)#

The path to the file displays in the email just fine as it should
"D:\inetpub\mydomain\documents\inst\Terms_of_Use.doc" which is a valid
path. But as soon as I hardcode the attachment code, or run the code that I have below with the attachment part, I do not get the mail. I do not get errors either. So it must be dying at the server and I cannot figure out why....

Any insight would be appreciated.

Thanks.

Jason


<cfmail to="#trim(email)#"
from="support@mydomain.com"
subject="#trim(attributes.Subject)#"
query="getRecipients"
server="#trim(request.mailserver)#"
username="support@mydomain.com"
password="MyPass"
failto="#trim(request.sendFailTo)#"
spoolenable="no">
<cfmailparam name="Reply-To" value="#Trim(attributes.fromAddress)#">
#ReplaceNoCase(ReplaceNoCase(ReplaceNoCase(attributes.message,"{last_Name}",
"#lname#", "ALL"),"{prefix}","#prefix#", "ALL"),"{first_name}","#fname#",
"ALL")#


======================================
Powered by: mydomain.com

If you feel this message has been sent in error please contact our support
department at: support@mydomain.com
<cfsilent>
<cfif trim(attributes.FileID) NEQ "" AND getInstFiles.recordCount NEQ "0">
<cfloop query="getInstFiles">
<cfif
FileExists("#trim(request.cfinstdocs)#\#trim(getInstFiles.fileName)#")>
<cfmailparam
file="#trim(request.cfinstdocs)#\#trim(getInstFiles.fileName)#">
</cfif>
</cfloop>
</cfif>
</cfsilent>
</cfmail>
0
jfill89
Asked:
jfill89
  • 6
  • 2
  • 2
  • +4
1 Solution
 
tim_csCommented:
How big is the file you are trying to send?  Maybe you should try and send a test file that is small and see if it gets through.  There might be limits set on how big attachments can be.
0
 
jfill89Author Commented:
It is only 45 K.  If that is too big then the system is worthless :).
0
 
tim_csCommented:
It's in a loop so are you sure the file is only being attached once or that other files aren't being attatched that is increasing the size of the email.


Most likely you have but have you checked the email account used as the "from" address to see if any error messages were sent there?
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
jfill89Author Commented:
Correct, no error emails in the account.

When I abort processing and dump the contents of the query, there is only one record that is going to be attached.  Like I said, even if I delete that and hard-code an attachment (that I know for 110% exists) it still does not get sent.

It is a mystery!!!!
0
 
MyrandorCommented:
Did you check in the log folder for any logs? I would suggest to enable the mail logging and look in the "outgoing" mail directory in case the mail are there.
0
 
jfill89Author Commented:
Yeah I am on a shared server.  I have asked the hosting company to look into it if they could.

Still waiting for a reply from them.
0
 
jfill89Author Commented:
Ok I figured it out.  It was the actual file I was attaching.....

I have not clue but I an attach any other file and it works just fine.  Now my question is, what could be wrong with that file??  I know the path was correct and the file existed.

Any ideas.
0
 
MyrandorCommented:
Maybe the SMTP server is refusing to send .DOC documents...?

Did you try to compress it before sending it? Or rename it to another extension?
0
 
jfill89Author Commented:
I can send other .doc files.  Just not that specific one....very odd.
0
 
JeffHowdenCommented:
Perhaps the file is infected and they scan before send to limit their liability.
0
 
jfill89Author Commented:
I was about to rename the file and send it just fine.  But the file as it was named Terms_of_Use.doc did not want to go.  Maybe a virus scanner caught it b/c of the name or something.

Very odd, but works now.
0
 
Matt GrofskyCommented:
This problem can occur as well if the file is open or in use by a process.  Your on a shared server so its not like its easy for you to reboot and try again, but I bet that would have fixed the problem.
0
 
gnosticgnowledgeCommented:
what version of coldfusion are you using?
0
 
GranModCommented:
PAQed with points refunded (125)

GranMod
Community Support Moderator
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 6
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now