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
liron169liron169 

Limitation of internal email

Hello,

 

I'm little bit confuse from all the different limitation in SF.

Can someone explain the limitation of sending emails from apex code to the working user?

I think that we don't have any limitation, but need to make sure



The code will be somthing like this...

 

for(String objid : objLst)
{
	Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
	
	email.setTargetObjectId(UserInfo.getUserId());
	email.setTemplateId('needToCreate');
	email.setWhatId(objid);
	
	emails_Lst.add(email);
}


Messaging.sendEmail(emails_Lst);

 

Best Answer chosen by Admin (Salesforce Developers) 
Satish_SFDCSatish_SFDC
If you use SingleEmailMessage to email your organization’s internal users, specifying the user’s ID in setTargetObjectId means the email doesn’t count toward the daily limit. However, specifying internal users’ email addresseses in setToAddresses means the email does count toward the limit.

 Link: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

 

 

You are using the setTargetObjectID method, so you are correct. There is no limitation.

 

Regards,

Satish Kumar

 

 

All Answers

Satish_SFDCSatish_SFDC
If you use SingleEmailMessage to email your organization’s internal users, specifying the user’s ID in setTargetObjectId means the email doesn’t count toward the daily limit. However, specifying internal users’ email addresseses in setToAddresses means the email does count toward the limit.

 Link: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

 

 

You are using the setTargetObjectID method, so you are correct. There is no limitation.

 

Regards,

Satish Kumar

 

 

This was selected as the best answer
liron169liron169

Thanks.