function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Create attachments in apex

My requirement is:


- create Case using Email-to-Case

- attach the Email attachments (if any) to the newly created Case as Attachments


is there a way i can attach the email attachments to the newly created Case in Apex?


Thanks in advance.

Perhaps this thread can get you started.

Thank you Shikibu,


For the time being my requirement has slightly been changed - working with related e-mails is enough, do not need to attach the incoming e-mail attachment(s) to the newly created case as attachment ( Note & Attachments ....).

if you start handling attachments, and your emailers use outlook, you're probably going to run into issues with the file format of teh attachments.  apparently outlook will send some wacky .dat file instead of the actual files, in some cases.  i dropped attachment handling due to this.
hank you very much paul-lmi.


I found the solution at Appexchange:link


By installing this package I get the e-mail attachments as the Case Attachments (under Notes & Attachment)  - which was my initial requirement.