Relates to the SingleEmailMessge class, which provides methods for sending single email messages through apex.

learn more… | top users | synonyms

2
votes
1answer
22 views

WHY Can't I Use SetTargetObjectId(UserId) and SetWhatId?

I have a very simple error handling case. I need to send an email to the running user, who almost certainly does not have an associated Contact record. I also need to specify the error record in ...
3
votes
0answers
42 views

How can I send an email alert every day to 5000 contacts

We want to send an email to contacts every day. There will be say 5000 contacts. I can't do this with apex code because there is a limit of 500 emails per 24 hour period. So I will have to do this ...
0
votes
1answer
16 views

SingleEmailMessage with public sites user throwing error

is anyone using a public site and sending an email with this public sites user through an apex class with the SingleEmailMessage Method. It always worked very well but since some time i get the error ...
0
votes
0answers
18 views

Dynamically assign an email id to setReplyTo in SingleEmailMessage

I looked at this and this. I am trying to send out an email to a user with the 'From' email assigned to the email of the record owner (dynamic). Clearly, setOrgWideEmailAddressId is not the answer. ...
0
votes
1answer
51 views

Why are my merge fields not populated when sending email through Apex?

I am using an email service and apex class to handle inbound emails and attach them to an associated custom object record. The same Apex class is also sending an email to the user in the "Assigned to" ...
0
votes
1answer
94 views

Send email with excel attachment - Blob variable doesnot exist error

I have a Map. that I built in apex class. I want to put that map output into an excel and send it as attachment. Here's the code that Im using. I get Blob variable doesn't exist error ( in the ...
0
votes
0answers
8 views

How to Monitor Automated emails sent from Salesforce in reports?

I am having an batch class that runs daily and send multiple emails to contacts. Now i run a report on contact object to check the deliverability of emails. There are two fields on contact object ...
0
votes
0answers
20 views

SINGLE_EMAIL_LIMIT_EXCEEDED in sandbox?

There is a limit on the number of emails you can send from Apex, this is 1,000 per 24 hours. We have a unlimited edition. My q is this is full sandbox email count is also coming in over all single ...
0
votes
2answers
48 views

Batch class approach restrict multiple email

I have a requirement to send mails some Users (DM lookup ids) notified about creation of records in a custom object based on a specific filter criteria. Now if there are records in different batches ...
0
votes
0answers
105 views

SingleEmailMessage with Visualforce Template doesnt work when setTargetObjectId is a NON visible community user?

Setup is as follows: A community User (UserA) is creating Events with Accounts (AccountB) (manually shared via Apex) and an email invitation should be sent to the Account Users (UserB). A trigger ...
3
votes
1answer
48 views

dailly email limits

I have gotten this error in production SINGLE_EMAIL_LIMIT_EXCEEDED I am sure i have maxed out the daily email limit of 1 000 limit info ...
0
votes
0answers
12 views

SINGLE_EMAIL_LIMIT_EXCEEDED [duplicate]

I wrote one trigger for sending mail to admin account. " SINGLE_EMAIL_LIMIT_EXCEEDED". anybody knows the solution? trigger MailToAdminAfterDeletingEmployee on Employee__c (after delete){ ...
0
votes
3answers
132 views

SendEmailError Messaging.SendEmailError[getTargetObjectId=null;]

I've written a method which should send messages to the current user, the System Administrator, and a list of other addresses that I specify. public static void sendErrorEmail(String body) { ...
1
vote
1answer
68 views

Get ActivityId From SingleEmailMessage

When sending a SingleEmailMessage from apex to a Contact, activities are automatically created for that Contact. I also want to log an activity on records that are related to this email. I can't use a ...
1
vote
1answer
699 views

How to override the FROM Email in Messaging.SingleEmailMessage

How to override the from email address in the email.But in my code throw an exception.How to set the Organization-Wide email addresses.When I comment the code "setOrgWideEmailAddressId(owe.Id);"it ...
1
vote
1answer
500 views

Trying to write a Trigger to send am email to Case Contact after CaseComment is posted

Here is the code I have so far: I keep getting the error message: Method does not exist or incorrect signature: Messaging.sendEmail(Messaging.SingleEmailMessage) trigger EmailCaseOwner on ...
2
votes
2answers
298 views

Can Salesforce SingleEmailMessage do not send to CC list?

I have a custom button which will send a SingleEmailMessage and below is my SingleEmailMessage code Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setToAddresses(new ...
0
votes
1answer
167 views

Messaging.sendEmail(<list of emails>) - Is it all or nothing if errors encountered (e.g. bounces)?

Recently I'm encountering some weird issues in Apex SendEmail() calls :-) Messaging.sendEmail(LIST<Messaging.Email>) can any one confirm if 1 item in the list of Emails to be sent errored out ...
4
votes
1answer
322 views

SingleMessage with TemplateId in Apex: need to add more recipients

I am writing code to send emails to contacts via Apex using templates. My issue is that I need to be able to copy these emails to various other users that are going to be determined at run time. This ...
0
votes
2answers
96 views

Are we limited to Sending Emails via Javascript Remoting function call only for 4-5 records?

I've implemented a JS Remoting function that accepts a Set of ID values as input. For all the ID values I loop around in code and use: Messaging.SingleEmailMessage mail = new ...
0
votes
1answer
396 views

Text in email should be bold

I'm writing a program where user inputs and email ID and i have to send an email to that email Id. but now my requirement is that some of that text needs to be in bold. Please tell me how to do it. ...
1
vote
3answers
465 views

When sending an email template and using the class 'SingleEmailMessage', can the sent email be attached to the case for reference?

When using auto-responders for email-to-case, the outbound emails are attached to the case. I'd like to perform the same action, when I am sending outbound emails via my own inbound email handler. ...
6
votes
1answer
147 views

gmail email relay work around or alternatives

I was wondering what other organizations using gmail have done for email relaying with Salesforce. My organization will not be removing the gmail authentication so I was wondering if there is a work ...
1
vote
2answers
375 views

Hiding settargetObjectId while sending email..?

Hi I have used contact as settargetObjectId and whenever an email is sent this contact emailid also get copied in the email list.. Is there any way to put this contact emailid(settargetObjectId ) in ...
1
vote
0answers
259 views

salesforce changes parent id of email Attachment to Case Id eventhough I set it to EmailMessage's Id

I am trying to create an Attachment with ParentId as the EmailMessage's Id but salesforce somehow changes it to the Case Id. I need the ParentId to be EmailMessage Id as I want to select attachments ...
0
votes
1answer
1k views

Spaces with Messaging.SingleEmailMessage setHTMLBody method

I'm using the Apex class Messaging.SingleEmailMessage.setHTMLBody() to send an email from Salesforce with prettier than ASCII formatting. For the life of me I can't figure out how to insert an extra ...
2
votes
2answers
1k views

Can't set toAddresses on email when templateId defined?

Question Did something change recently with the SingleEmail methods that prevents using setToAddresses() when a template is used? Background I need to send an email to a user based and pass in the ...
6
votes
1answer
1k views

Long Text field in Report Workaround

So I know that Rich/Long text fields will automatically get truncated when running a report in the UI or when trying to schedule a report. I get this and think this is something that should be in ...
3
votes
1answer
52 views

Threading emails onto a lead

I'm working on a project that takes care of sending emails to customers who sign up with us. The project automatically creates a new Lead for every customer that signs up, but we next want to store a ...
2
votes
1answer
1k views

INVALID_CROSS_REFERENCE_KEY in send email method

We a custom object(child) which is a detail of Opportunity (OWD = private). Whenever a partner user creates this child record sendEmail is method is invoked from the trigger. We have field ...
5
votes
4answers
5k views

single email limit exceeded salesforce very frequently..?

my email limit is exceeded after sending 10-12 emails..what could be the problem..as i have seen the limit is 1000 emails/day.i am not able to find out what could be the problem..Can some give me some ...
1
vote
1answer
1k views

Related custom object with Mass/Single EmailMessage

I need to write an apex method that send an email which is related to a custom object. The email will use a template which used merge fields from the custom object. How can I specify the custom object ...
3
votes
1answer
278 views

Detect if Compliance BCC Email is enabled

Problem: If the Compliance BCC Email setting is enabled email messages cannot be sent with custom BCC addresses e.g. Messaging.SingleEmailMessage toSend = new Messaging.SingleEmailMessage(); ...
4
votes
1answer
213 views

Avoid blacklisting of Org-Wide email address

We are using the apex method Messaging.sendEmail.setOrgWideEmailAddressId() in a schedular class to send emails to our customers, But our concern is when sending internet email.. you never want from ...
1
vote
1answer
1k views

Singleemailmethod with BCC and Template ID

I am using a batch class with 4 differnt VF templates to send emails to 4 different regional heads usingsingleemailmethod() so I am using 4/10 singleemail methods in the batch class. singleemail ...
8
votes
2answers
475 views

Ignore user context while sending SingleEmailMessage

Can we send SingleEmailMessage(s) under admin context and ignore current user sharings and profile access. Details: - visualforce email template is related to object B which is not available for users ...
7
votes
3answers
2k views

What's the Advantage of using MassEmailMessage instead of multiple SingleEmailMessage?

I'm scoping out a project that will involve sending outbound email messages, and I'm a little confused about why one would use a MassEmailMessage instead of multiple SingleEmailMessages. If you look ...