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:


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.



<cfmail to="#trim(email)#"
<cfmailparam name="Reply-To" value="#Trim(attributes.fromAddress)#">
"#lname#", "ALL"),"{prefix}","#prefix#", "ALL"),"{first_name}","#fname#",

Powered by:

If you feel this message has been sent in error please contact our support
department at:
<cfif trim(attributes.FileID) NEQ "" AND getInstFiles.recordCount NEQ "0">
<cfloop query="getInstFiles">
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
jfill89Author Commented:
It is only 45 K.  If that is too big then the system is worthless :).
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?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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!!!!
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.
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.
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.
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?
jfill89Author Commented:
I can send other .doc files.  Just not that specific one....very odd.
Perhaps the file is infected and they scan before send to limit their liability.
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.
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.
what version of coldfusion are you using?
PAQed with points refunded (125)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.