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
Abhishek MahajanAbhishek Mahajan 

SendEmail method Email bounce issue

Hi,

I am sending an email to a couple of contacts and got follwoing error,
System.EmailException: SendEmail failed. First exception on row 0; first error: EMAIL_ADDRESS_BOUNCED, The target object email address is currently marked as bounced.
Following is my apex code:

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(sendTo);
mail.setTemplateId(templateId.Id);
mail.setTargetObjectId(con.id);
mail.saveAsActivity = false;
mail.setWhatId(a.Id);
mails.add(mail);
Messaging.sendEmail(mails);

where sendTo is a list of string containing all email address.

Just wanted to know, will the contacts other than the one for which above error occured will receive email or SendEmail will fail for all contact in that list.

Thanks
Carlos Campillo GallegoCarlos Campillo Gallego
Hi Abhishek,

I believe that every email is treated independently, so they should be receiving those emails. Anyway you should try to send some emails to yourself while this bouncing contact is also in the recipients list.

Regards.
niven sfniven sf
Hi! I am getting error with sending emails, EMAIL_ADDRESS_BOUNCED, The target object email address is currently marked as bounced can anyone please help me
 
Michael Olson 8Michael Olson 8
I believe the issue is that the contact is already flagged as bounced prior to sending via apex.  Navigate to the contact record you are sending to and unmark as bounced.  Apex will not send emails to bounced contacts until they are corrected.