tracker issue : CF-3359625

select a category, or use search below
(searches all categories and all time range)
Title:

Cfmail using wrong content-type

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Mike Greider / Mike Greider (Mike Greider)

Created: 11/05/2012

Components: Net Protocols, MAIL

Versions: 2016,11.0,10.0,9.0.1

Failure Type:

Found In Build/Fixed In Build: 9.0.1 /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7

Vote Count: 2

Problem Description: When sending attachments with CFMAIL, the content type is always multipart/related. This forces some clients, like the iPhone and iPad to not recognize the attachments. It causes other clients, like Thunderbird, to only recognize an attachment when you load the message, and it will not forward the attachment as you would expect.

Steps to Reproduce: Create any CFMAIL message, use <cfmailparam> to attach an attachment.

Actual Result: Email is sent with content-type multipart/related

Expected Result: Email should be sent with content-type multipart/mixed or multipart/alternative

Any Workarounds: None that I know of.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3359625

External Customer Info:
External Company:  
External Customer Name: Mike Greider
External Customer Email:  
External Test Config: My Hardware and Environment details: CF 9.0.x, Windows 7

Attachments:

Comments:

I find that this is working. Are you setting "type"? <cfmailparam file="/document/path/mypdf.pdf" contentID="#createUUID()#" disposition="attachment" type="application/PDF"> When sending multipart mail - I see the proper types for each part. This is from cf9.0.1 fully patched and using two different mail servers. http://www.trunkful.com/index.cfm/2010/5/27/How-to-CFMAIL-Properly-and-Keep-the-SPAM-in-the-Can
Comment by External U.
17288 | November 05, 2012 05:40:32 PM GMT
@wilgeno - Yes, the content type of the attachment is getting set correctly, but not on the message itself. Used this simple test case: <cfmail to="[email]" subject="test attachment" from="[email]" > <cfmailpart type="text/plain" charset="utf-8">Hi, this is a test message</cfmailpart> <cfmailparam contentid="#createUUID()#" file="d:\bookmarks.pdf" remove="False" type="application/pdf" /> </cfmail> The resulting message does have the right content-type values on each individual content part, but the top content-type in the header is incorrect. Here is the source: Return-Path: [email] Received: from [scrubbed] ([127.0.0.1]) by [scrubbed] ; Thu, 28 Feb 2013 15:18:17 -0500 Date: Thu, 28 Feb 2013 15:18:17 -0500 (EST) From: [email] To: [email] Message-ID: <803739343.8.1362082697769.JavaMail.[scrubbed]$@127.0.0.1> Subject: test attachment MIME-Version: 1.0 Content-Type: multipart/related; <----------------------------------------------------- THIS IS THE TROUBLE PART boundary="----=_Part_7_614381217.1362082697768" X-Mailer: ColdFusion 10 Application Server X-Antivirus: AVG for E-mail 2013.0.2899 [2641/6138] X-AVG-ID: ID5E41BB29-44CA9E83 ------=_Part_7_614381217.1362082697768 Content-Type: multipart/alternative; boundary="----=_Part_6_192314837.1362082697768" ------=_Part_6_192314837.1362082697768 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, this is a test message ------=_Part_6_192314837.1362082697768 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ------=_Part_6_192314837.1362082697768-- ------=_Part_7_614381217.1362082697768 Content-Type: application/pdf Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=bookmarks.pdf Content-ID: <588D2B3F-BC5F-F443-FF243F3E4049340F>
Comment by External U.
17289 | February 28, 2013 02:55:03 PM GMT
Also, this same issue is in CF 10.
Comment by External U.
17290 | February 28, 2013 03:01:00 PM GMT
I was able to work with Mike on this and discovered what was causing the issue. I detailed this is my blog post here. http://www.trunkful.com/index.cfm/2013/3/1/CFMAIL-Attachments-to-Apple-iPad-and-iPhone At this point I do not think this is a bug.
Comment by External U.
17291 | March 01, 2013 11:48:25 AM GMT
This is a bug and it's present from CF8 onwards and impacts iphone/ipad email clients. The workaround mentioned here is not helping if you need to include 2 or more attachments where one is an embedded image (such as a logo at the top of the email) and another is a non-embedded file. The contentID argument for the embedded image is necessary to give the image a name so you can control where it's placed within the body of the email. By specifying contentID the Content-Type applied by CF in the header is multipart/related rather than multipart/mixed. The end result is iPads and iPhone fail to realise there's an attachment. I tested it at Litmus.com which provides a view of 30+ different email clients. About 40% of our emails are read on i-devices so I really need to find a programmatic solution for now, plus this bug needs fixing for future releases of CF.
Comment by External U.
17292 | December 17, 2013 10:01:12 PM GMT
There is no workaround if you need to embed an attached image using contentID *AND* attach a non-embedded file. Apple i-devices fail to realise there's an attachment.
Vote by External U.
17295 | December 17, 2013 10:03:21 PM GMT
This bug is also available in Cold Fusion 10 latest patch, very anoying, since there is no workaround to send a reliable mail for all mail clients..
Vote by External U.
17296 | December 02, 2014 09:14:22 AM GMT
Has this not been fixed after 5 years and 3 new releases of CF? It's been so long I don't know which of these comments by "External User" are mine! Please add a comment regarding today's status change to "HaveNewInfo".
Comment by Gary F.
17293 | July 31, 2017 11:15:32 AM GMT
@Gary, the HaveNewInfo was meant for QE engineer in the team.
Comment by Vamseekrishna N.
17294 | July 31, 2017 12:43:57 PM GMT
Hi Mike,   Here is the snippet, I have used to repro the bug:   <cfmail from="xxxxxxx@gmail.com" username="xxxxxxx@gmail.com" server="smtp.gmail.com" port="465" usessl="true" spoolenable="false" to="xxxxxxx@gmail.com" password="XXXX" subject="sub body is missing!" debug="true"> <cfmailparam disposition="attachment" file="test.pdf"> <cfmailparam disposition="inline" contentid="sample" file="rabbit.jpg"> <cfmailpart type="text/plain" > This is text part of the message </cfmailpart> <cfmailpart type="text/html" charset="Utf-8" > <h3>HTML Message</h3> <b>Bold</b> <img src="cid:sample" width="200" height="300" alt="Image"> </cfmailpart> </cfmail>   Here is the raw data of the mail: Return-Path: <xxxxx@gmail.com> Received: from by smtp.gmail.com with ESMTPSA id a11-v6sm7660124pgn.64.2018.05.17.05.58.04 for <xxxxx@gmail.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 05:58:21 -0700 (PDT) Date: Thu, 17 May 2018 18:28:04 +0530 (IST) From: xxxxx@gmail.com To: xxxxx@gmail.com Message-ID: <1340458927.3.1526561884603@smtp.gmail.com> Subject: sub body is missing! MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1_1493392488.1526561884589" X-Mailer: ColdFusion 2018 Application Server ------=_Part_1_1493392488.1526561884589 Content-Type: multipart/alternative; boundary="----=_Part_0_743503667.1526561884589" ------=_Part_0_743503667.1526561884589 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit This is text part of the message ------=_Part_0_743503667.1526561884589 Content-Type: multipart/related; boundary="----=_Part_2_742450622.1526561884590" ------=_Part_2_742450622.1526561884590 Content-Type: text/html; charset=Utf-8 Content-Transfer-Encoding: 7bit <h3>HTML Message</h3> <b>Bold</b> <img src="cid:sample" width="200" height="300" alt="Image"> ------=_Part_2_742450622.1526561884590 Content-Type: image/jpeg; name=rabbit.jpg Content-Transfer-Encoding: base64 Content-Disposition: inline; filename=rabbit.jpg Content-ID: <sample> ------=_Part_2_742450622.1526561884590-- ------=_Part_0_743503667.1526561884589-- ------=_Part_1_1493392488.1526561884589 Content-Type: application/pdf; name=test.pdf Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=test.pdf ------=_Part_1_1493392488.1526561884589-- Can you let us know, if you are sill facing this issue?
Comment by HariKrishna K.
27847 | May 17, 2018 01:25:30 PM GMT
Hi Mike, This is the snippet, I have used and I don't see any issues: <cfmail from="xxxxxxx@gmail.com" username="xxxxxxx@gmail.com" server="smtp.gmail.com" port="465" usessl="true" spoolenable="false" to="xxxxxxx@gmail.com"  password="XXXX" subject="sub body is missing!" debug="true"> <cfmailparam disposition="attachment" file="test.pdf"> <cfmailparam disposition="inline" contentid="sample" file="rabbit.jpg"> <cfmailpart type="text/plain" > This is text part of the message </cfmailpart> <cfmailpart type="text/html" charset="Utf-8" > <h3>HTML Message</h3> <b>Bold</b> <img src="cid:sample" width="200" height="300" alt="Image"> </cfmailpart>  </cfmail>   Closing the bug as Withdrawn/NotABug, as there is no response from the customer.  
Comment by HariKrishna K.
29500 | August 16, 2018 06:11:37 AM GMT