23

There is a limit on the number of emails you can send from Apex, this is 5,000 per 24 hours and you would need to raise a case and engage with Salesforce to get this raised. I think that the error message you are seeing there refers to a different limit, which is that you can only call sendEmail 10 times within the same context. Is it possible that your ...


19

What MassEmailMessage appears to give you is a more optimal coding route if you are focusing on sending to Contacts, Leads or Users relating to either Contract, Case, Opportunity or Product objects. So if you had 50 such Contacts to email you need only have a single MassEmailMessage instance and set a list of those Id's into it. Instead of creating 50 ...


9

I can confirm Salesforce changed the daily limit for Developer Edition orgs to 10 a few releases ago, this is indeed a significant drop from the before 1000. It caused issues with our development and testing teams. Eventually we made a case to get it raised back up to 1000 for some of our DE orgs, suggest you contact support and request the same, at least ...


9

Single Messaging has limits as you cannot call sendEmail method more than 10 times in single transaction and 1000 e-mail per license per day. Some how you are hitting these limits. If you are sending email to organization internal users in that case you should use setTargetObjectId(userId) instead of toAddress. Pass user Id in that method. ...


8

There is a new feature in Spring 13 where the access to send email (Administration Setup - Email Administration - Deliverability) is set to "System email only" for newly refreshed sandboxes.


7

setTargetObjectIds method of MassEmailMessage can accept an Array of ID for contact, lead and user id's, while you will need to create individual elements for the Array of SingleEmailMessage. However SignleEmailMessage allows you to pass any external email address. So there is a Heap gain if you prefer to send emails to Salesforce Leads, Contacts, or users ...


7

Salesforce Spring '13 introduced a new email deliverability setting (Setup > Email Administration > Deliverability). New sandboxes created on Salesforce Spring '13 will have this automatically set to "System email only," causing this error. This setting must be changed to "All Emails" in order not to throw that exception. Details are on page 46 of the ...


6

It seems that Salesforce converts attachment to html links when total size exceeds 3Mb. This is very annoying. Source 1 Source 2


5

I don't think the Java API enforces any limitations on its own but you need to be coherent with the overall ExactTarget API guidelines which clearly state Keep your triggered send batches of Subscriber objects to numbers smaller than 100 for asynchronous calls and less than 50 for synchronous calls. Keep your maximum payload per call at less than 5MB. ...


5

Your entire test method is treated as a single transaction. Since you have the insert inside the for loop, you are executing sendMail 11 times in this single transaction, and thus you get the error. You need to create a list of P__c records and then insert the list outside the for loop.


4

If you can differentiate the types of cases via which email address the email was sent to, you could query the EmailMessage object to figure this out. Let's say the cases you're interested in are all sent to yourteam@company.com. Then something like this in your case insert trigger should work: Case theCase = Trigger.New[0]; EmailMessage msg = [select Id, ...


4

From the doc Visualforce email templates cannot be used for mass email So - how to get around this? You will need to use a custom field, Workflow email alerts + field update In your trigger or VF controller, when the affected record(s) are ready to have their mass email sent, mark custom field is_ready_for_mass_email__c to true The workflow will execute ...


4

You can access the 'old' and the 'new values in an after trigger. You already access the new values in trigger.newMap. The old values are in trigger.oldMap :-) So compare the old and new value of the field in your code. trigger SendEmailToHiringManger on SFDC_Job_Opening__c (after insert, after update) { list<SFDC_Job_Opening__c> i = [select id,...


3

setBccAddresses is a Single Email Message Method. Only Base Email Message Methods and those methods that are specific to the Mass Email Message Class are permitted when sending bulk emails via Apex. Using a template, you would need to either assign a WhoID to the BCC field of your template or else use the setTargetObjectIds method to assign other values to ...


3

If you need/want a configuration only solution (no apex), you can do you this. Define a specific case origin for each of you E2C addresses, and set then on the emails as appropriate. For example "Email-Support" or "Email-Info". To prevent your users from accidently selecting these sources, create a validation rule that only allows your default case ...


3

This error is because the method msg.setTargetObjectId(BDM.Id ) uses User Id and as per documentation you need to use msg.setWhatId(cas.Id) only when setTargetObjectId is contact. http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_Messaging_SingleEmailMessage_setWhatId.htm I faced same issue yesterday


3

ExactTarget has a wide variety of solutions. Here's a link to information on our Small Business offerings: http://www.exacttarget.com/clients/small-business. This is really going to depend on the budget your organization has available and what your customer communication roadmap is. There are quite a few solutions for email, that's where many of those ...


3

You can set the Organization wide email address by going to: Your Name | Setup | Administration Setup | Email Administration | Organization-Wide Addresses. Here you can add addresses and assign them to roles/profiles. When sending an email you will then have the option to select which "from" profile you would like to select.


3

Mike, this is a very common issue and one that I have yet to solve gracefully. The closest I have been is to make a custom button or link that takes the name out of the subject and links through to the mass email template. The issue with this is if there are mass emails with the same name, it will possibly pick up the wrong one. If your team is using mass ...


3

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_forcecom_email_outbound.htm If you carefully read this document the email limit for a day is 1000 emails/day but the problem is you are hitting context limit. In a single context you can just send 10 emails through SendEmail().So i am sure you are triggering this through trigger and for bulk ...


3

The documentation that you cited means that there is no limit to a user in your organization sending through the Salesforce UI on a Contact, Account, Lead, etc. detail page from Send An Email button on the Activity History related list. The daily email limit of 1,000 sending through apex still applies.


3

You can write a test class that updates a "SFDC_Job_Opening__c" record. Messaging.sendEmail(..) can't be tested using testmethods as testmethods won't send emails. The code will be 'invoked' but the email will not be sent (for obvious reasons - your testmethods could spam legitimate email addresses). So you will get some "coverage" to your trigger. By ...


3

Support says that Salesforce previously hardcoded the number to 250, but have since started treating this as a limit based on the type of the org. For trial orgs, the undocumented limit became 10. They quoted email limits section which states: In Developer Edition orgs and orgs evaluating Salesforce during a trial period, you can send mass email to no ...


3

You would use a scheduled job to run a batchable job to send out the emails. That would look like this: public class DailyReminders implements Schedulable, Database.Batchable<Sobject> { public void execute(SchedulableContext sc) { Database.executeBatch(this, 100); } public Database.QueryLocator start(Database.BatchableContext context) { ...


2

There are couple of ways to accomplish this task. Please check my blog post titled 'Dynamically populating custom HTML email template content in Force.com with custom dynamic data using Apex' which uses custom HTML email templates to send email with data populated from both standard object and dynamically computed data. The code referenced in this article ...


2

Well, you can only call sendEmail 10 times in a context. But each call can contain multiple messages. You have it coded to only use a single entry in the list for each send So where you have Messaging.SendEmailResult[] resultMail = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); You could have something like List<Messaging....


2

You might want to check out something like ExactTarget which was recently acquired by SFDC and is part of their Marketing Cloud. There are APIs for it too. It can handle sending more emails.


2

I think you need a Junction Object that has two Master-Detail Relationships: Master-Detail Relationship with Contact Master-Detail Relationship with ContactGroup__c Maybe call this Junction Object Contact_Junction__c. The Junction Object allows for a many-many relationship between two other objects. Try it out, and see what your related-lists look like. ...


2

Mass email is sent as the user in the current execution context. In other words, the user that sends or schedules to send a mass email will be the delivery address and display name by default. In Apex Code, you can specify an alternate Reply To address and/or a display name, both of which default to the user sending the email. If you specify a BCC, one copy ...


2

Just populate a List with the retrieved data and use it for your setTargetObjectIds method. List <Id> targetObjectIds = new List <Id> (); List <Contact> targetObjects = new List <Contact> (); targetObjects = [SELECT Id FROM Contact]; for(Contact cnt : targetObjects) targetObjectIds.add(cnt.Id); Messaging.MassEmailMessage mail = ...


Only top voted, non community-wiki answers of a minimum length are eligible