Apache mail common comes as out of box in Adobe CQ5 platform as OSGI bundle and and CQ has its own API on top of that can be used to send all kind of email
- Plain text
- HTML Formatted
- and any kind of attachment.
Code snippets to send email. Please refer to the document
When you send email as plain text , you would not see much difference in terms of formatting for different-2 mail client , but when it is HTML formatted you would find it varies across outlook, Gmail, Yahoo even on Smartphone.
Retest it correct your HTML CSS class etc to ensure it looks uniform across all kind of mail client. Also if you are mail content has java script or long hash based query string data are not going work in email ..remember mail box is not browser, its Application and mail server apply their own set of security.
One of the primary reason why i wrote this blog is that outlook consistently shows this attachment (ATT00001.htm) attachment when we sent HTML formatted email content but same was not appearing in G-Mail and Yahoo. refer to the below image attached.
I referred multiple post and forum and everybody has their own understand and interpretation but none has worked for us.
Few URL worth sharing here.
it’s code issue and nothing else.
- Email object was not created on right place.
- Session object too
- also email recipients
When finally code was rescanned and arranged that attachment stopped coming in outlook.