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
KeithJKeithJ 

Mass Email Message & Attachment

Hi there. Is it possible to set an attachment for a Messaging.MassEmailMessage object?

I hope so!

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Jeremy-KraybillJeremy-Kraybill

Per the Apex docs, the setFileAttachments() method only exists on SingleEmailMessage, so no.

 

However, you could just instantiate a number of SingleEmailMessage instances in a loop, one per recipient, and add attachments to those. You can only call sendEmail 10 times per Apex invocation, but each call to sendEmail can take a List of SingleEmailMessages.

 

HTH

 

Jeremy Kraybill

All Answers

Jeremy-KraybillJeremy-Kraybill

Per the Apex docs, the setFileAttachments() method only exists on SingleEmailMessage, so no.

 

However, you could just instantiate a number of SingleEmailMessage instances in a loop, one per recipient, and add attachments to those. You can only call sendEmail 10 times per Apex invocation, but each call to sendEmail can take a List of SingleEmailMessages.

 

HTH

 

Jeremy Kraybill

This was selected as the best answer
KeithJKeithJ

Hi Jeremy.

Thanks for the reply. In the end this is what I did - the loop with the sendMail invocation.

However, I was unaware of the 10 mails per Apex invocation restricition.

This isn't a concern though.

Thanks again for your reply

Venu EVenu E
Hello KeithJ, 

MassMailer Attachments Send Large Files and Control How Long They’re Available.

Have you ever wanted to send out a whitepaper, pricing sheet, product PDF, or other unique or large file, but you weren’t sure how? MassMailer Attachments is the answer you’re looking for. Share files with your contacts without any fuss and without having to use multiple services.

For this, you can visit and play with this app free trail for 15 days -

https://appexchange.salesforce.com/listingDetail?listingId=a0N30000005uxj5EAA

Do you want to know more details click here https://goo.gl/e0RtSm

Regards
Venu E