Search code examples
coldfusiongmailimapemail-attachmentsgmail-imap

How to get all the inline images CID values from IMAP using coldfusion?


In my scenario, I've sent a mail with the pasted image in Gmail. I've put a dump to get the IMAP all emails list. That mail has displayed and the pasted image considered as an attachment. The attachment named as image.png. So that images CID will display in the cids column. Here when I pasted two images then the cids column display only the second added image's cid value. Because here the both pasted images named as image.png.

If I attach the file means that will working fine. The attachment filename have the original file name jellyfish-Copy5.jpg. so that is displaying the proper cid. I've added the dump details as image.

Email message with single Pasted Image:

enter image description here

Email message with Multiple Pasted Images:

enter image description here

Email message with Both Pasted and Attached Images:

enter image description here

So that How can I get both pasted images CID values from the query or what I want to do display both values into the cids column? Please guide me on this to get the CID values.

Thanks in advance!


Solution

  • As per the documentation of cfimap if the mail body have more than embedded images then it will take the last embedded image's CID.

    If the e-mail message contains more than one embedded image, only the last embedded image is available.

    Please refer it here https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfimap.html