Questions tagged [singleemailmessage]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

Outbound Email and Add Error are not working together

Actually i want to send email whenever duplicate record will create in salesforce and also show the error "Duplicate Account found" . I'm using for sending email through Outbound Email for salesforce ...
0
votes
2answers
265 views

sObject type 'SalesforceIqUser' is not supported

So I am trying to send out an email in the system and I am getting this error but I am at a loss. Everything that I am seeing has issues internally where you have to reach out to salesforce to have ...
0
votes
1answer
33 views

getting error while using SendEmail in batch class

I'm trying to send email to list of users using batch class, but its throwing below error for few records. Error: System.EmailException: SendEmail failed. First exception on row 0; first error: ...
2
votes
1answer
46 views

Visualforce as PDF error

I am creating a VF page where I have to select date and filter data and using button I need to send the another VF page as PDF with same data in email as attachment. When I selecting Date from 1st VF ...
0
votes
1answer
21 views

How do I test a schedulable email sending?

I have a schedulable apex class for the email sending. I tested a schedule, but I can't to coverage sending logic. Is there a some way to test good and bad scenarios for it? My class: public class ...
-2
votes
1answer
22 views

Salesforce Messaging.SingleEmailMessage Test Class

Can anyone help me get test coverage for Messaging.SingleEmailMessage? I'm using email template. Whenever a Case closes, it should send email to Contact.Email and bcc emails of the custom label. How ...
0
votes
1answer
39 views

Messaging.SingleEmailMessage email fails with invalid email address when using Target Object Id

I have a custom object that allows my users to create series of emails to their clients. I have a scheduled Apex job running hourly that scans for emails that are schedule to go out, creates the ...
0
votes
0answers
15 views

Problem sending email with attachment

I have a method to send email with attachment but some weird stuff keeps occuring where some emails + attachment arrived to the accounts that are returned by the query but some didnt receive anything ...
0
votes
0answers
37 views

How to add cc & bcc in Messaging.SingleEmailMessage Email and simultaneously avoid single Email limit being hit

My requirement is to send single email with To/Cc/Bcc added. All the email Ids belong to internal users. Initially, when I was passing the User.Id to these methods, I was hitting the Single Email ...
0
votes
0answers
86 views

Trigger sends more than one email

This email will send an email alert when an account has 8 cases open within 7 days. The email is being sent, but multiple emails for the Same account are being sent. I believe it has something to do ...
0
votes
1answer
24 views

Apex SingleEmail using template and userId

I'm trying to send a Messaging.SingleEmailMessage in Apex using a Custom Email Template to a specific User and using a defined OrgWideEmailAddress. The simple code is here: List<Messaging....
2
votes
0answers
17 views

Checking if an ORG Wide Email Address has been verified in Apex [duplicate]

I'm running into an issue where emails are not sending when an Org Wide Email Address is not verified. No exception is thrown either. In apex, I'm resolving the ORG wide that matches the users email: ...
-2
votes
2answers
61 views

How to call report in xlsx file format

could you please help me how to call report Xlsx file format, i am tried to below code, but i am not get the result: public class BatchUtilClass { @future(callout=true) public static void ...
0
votes
1answer
14 views

Remove email signature after sending single email with email template

here is the scenario. UserA has email signature in his setting. When clicking on a custom button, a template email is sent out to Person_B with sender UserA's name. Now the sent out name has 2 email ...
0
votes
1answer
32 views

How to set default value for List<Id> parameter and use it as argument

I have List as a parameter of the method but get the error when saving the class Error: Compile Error: Method does not exist or incorrect signature: void createEmailMessage(Id, OrgWideEmailAddress, ...
0
votes
1answer
34 views

Passing argument to List<Messaging.SingleEmailMessage> method

Hi I create List method with many parameters required than later be called in another void method sendRenewalReminder but I get this error Error: Compile Error: Method does not exist or incorrect ...
-3
votes
1answer
20 views

Sending Email while accessing fields from SOQL [duplicate]

Parent_Project_if_applicable__r is a lookup relationship on the Case object to the Parent_Project_if_applicable__c object. The If Block will send a group of emails to the addresses pulled from the ...
0
votes
0answers
13 views

Send Massive different emails to different contacts limitation

In my case, I have an email template. To construct the email body, I extract data based on who the contact I'm emailing to. For example, I send red-marked cases to user1, green-marked cases to user2, ...
0
votes
1answer
27 views

Sending Bulk message error

I have been working on Messaging class where I have to fetch records and need to send indivisual customer mail Vf page as PDF with their individual records. When I get this records and put into the ...
0
votes
1answer
27 views

Too Many Email Invocations / Sending ALL attachments

Problem: I am sending 1 confidential pdf for each contact. I am using SingleEmailMessage. When I include the Messaging.SendEmail() inside the For Loop and send it to no more than 10 contacts, each ...
1
vote
1answer
20 views

Is there any way to send an email from Apex to Email-To-Case, with dynamic from address instead of Running User

I have a form, where the user will fill all the information. Once the record gets created I wanted to invoke the Email-To-Case by passing record Id as the subject. Here, I wanted to set the From ...
0
votes
0answers
24 views

Email sending from Sandbox is Inconsistent

In one of our sandbox, we are testing some funcationality which sends the email from workflow when ever a case with specific subject is created. But the problem is email sending is very inconsistent i....
0
votes
0answers
54 views

Reply EmailMessage using SimpleEmailMessage apex class

In an Email-To-Case process, after receiving an email, a Case and an EmailMessage (A) are created. When the case is updated and a condition is verified, a "reply" email (related to Case and to the ...
0
votes
0answers
24 views

Email Message Object - Sanitize HTML Body

I use an output panel and rerender to display the HTML Body of an Email Message object query that is invoked by a user. There is an issue (confirmed by Salesforce Support) with rerendering an ...
0
votes
0answers
29 views

Email not sent from Partial Sandbox using Batch

I have a simple batch job that is used to send a notification email. I'm testing in a partial sandbox, but the email is not coming thru. Here is what I've checked: I verified that deliverability is ...
0
votes
0answers
19 views

Outbound Email With Inline Image

This is not a problem that needs an immediate solution but I have been thinking about it and researching it and I don't have an answer so I figured I would ask the community. I am writing a VF page ...
2
votes
1answer
28 views

test class for opportunity trigger not fully testing the entire code

my trigger trigger EmailTest on Opportunity (before insert) { id ac; List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>(); for (Opportunity opp : trigger....
0
votes
1answer
68 views

What Are IP ranges for APEX outbound emails to be used with SMTP Relay?

I am trying to configure SMTP Relay with GMail through salesforce. I have white-listed all the email Ips and ranges called out in the salesforce help doc in Gsuite for smtp relay, and it seems to be ...
5
votes
1answer
81 views

Streaming API not working when email is sent from Apex Batch

I have a Batch class that updates Last_Date__c on Project__c object in the Finish method. I have a PushTopic 'LastDateUpdate' on Project__c which is fired when Last_Date__c is updated. I'm ...
2
votes
1answer
189 views

Missing email activity when SendEmail failed: EMAIL_ADDRESS_BOUNCED, The target object email address is currently marked as bounced

Salesforce recently stopped creating email activity records for emails which failed because they bounce. Below is the error I am getting: SendEmail failed. First exception on row 0; first error: ...
1
vote
0answers
12 views

What is the difference between Mass email and single email? [duplicate]

i'm writing some code that is going to be sending email reminders to customers. I don't know whether to use single email with a loop to generate all the emails and send them out as a list or to use ...
0
votes
2answers
56 views

How to test and assert email template?

I'm getting this error: System.DmlException: Insert failed. First exception on row 0; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-...
0
votes
0answers
15 views

VF Email template - send different bodies to same person

I have a batch which I use to send emails to contacts - the emails are Messages about courses - so Each Contact should have the same email template repeatable with a different body. So, I created a ...
1
vote
0answers
21 views

Email Relaying Not Working When email is sent from Apex

Our application has a few features where we allow the user to generate documents and send emails. This is all custom lightning components and apex code. We send the emails using SingleEmailMessage. ...
1
vote
0answers
114 views

Email Limit on Scratch Org?

Working in SFDX with a scratch org. I'm setting up a future method to send an email if it fails, trying to get the formatting right, and testing. Now, I've hit a wall: SINGLE_EMAIL_LIMIT_EXCEEDED, ...
0
votes
0answers
28 views

Messaging.SingleEmailMessage translated labels

I have a batch that sends an article through email to contacts. I have a field in the Article Object which indicates the lang of the article. I'm using Messaging.SingleEmailMessage and I have ...
0
votes
0answers
49 views

Send email with different language via Apex

I have a batch process which I'm creating Emails without a template - with HTML Body - which there I should style the emails and send them to the contacts. The emails are built in a way which I go ...
0
votes
0answers
67 views

SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, DML currently not allowed: []

Need some help in understanding error , SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, DML currently not allowed: [] . I get this error when calling send email method ...
0
votes
0answers
12 views

View the history of SingleEmailMessage usage

I know how to see how many SingleEmailMessages we've sent in the current GMT day, but I need to know if it's possible to see a history of emails further back than that. For example, for the past week, ...
0
votes
0answers
50 views

Attachments are not visible if setWhatId is not defined while email from Apex

I am sending email to selected Contacts (Custom Component) via Apex. User will also be attaching multiple files to the email. If setWhatId(setting it to Case) is defined, EmailMessage Activity shows ...
0
votes
1answer
25 views

user merge fields doesn't replace by user record ID

I am trying to send email through email template to user but It is always replacing the user merge fields by org admin's user name instead of targetobjectID user. Org admin : luke wright Email ...
1
vote
1answer
160 views

SendEmail Method results in EmailMessage Object in Sandbox - Does not in Production

I am using the following logic to send emails. Enhanced email is activated on both orgs and so is Email-to-case. In the sandbox (Summer '19), executing this method results in an email message ...
0
votes
0answers
70 views

Community Profile User unable to send APEX emails

I have a class containing this method that creates an email in APEX and sends it out once the method is called. public static void generateMessagingTemplates( String requestLogId){ String ...
0
votes
0answers
69 views

The content that i received through mail as a pdf attachment is partial of the actual content sent

public static String AcceptTnC(String contractInfo2){ system.debug('contractId2'+contractInfo2); Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage(); Messaging....
0
votes
0answers
37 views

ReRendering Output Panel with MHTML String Fails

I am rerendering EmailMessage HTML Bodies onto visualforce pages. For most emails this is not a problem, however for one email the rerender never completes. Research into this suggests some sort of ...
0
votes
0answers
33 views

PDF Generation: Classic Email Template Content is counted in Salesforce Apex Code Limit?

We need to send PDF based on salesforce record. For this we have used Classic Email Template and Messaging.Singleemailmessage class to send PDF as attachment. We have used custom template for ...
0
votes
1answer
41 views

Single Email limit per execution using Apex Trigger [closed]

How many emails will be send using trigger per execution?
2
votes
1answer
253 views

Invalid Message Id Reference - In-Reply-To Header is Not Valid

I am designing a custom mail application with Visualforce and Apex in salesforce and I'm running into some issues maintaining threads and setting reply to ids. To establish which emails are a ...
0
votes
1answer
75 views

HTML Email Status won't get created if setWhatId() for Messaging.SingleEmailMessage is specified

In my org I've set up an automatic process that sends email messages with the Custom template (with the HTML) to the contact. It has triggered similar code: OrgWideEmailAddress addr = [select Id from ...
2
votes
1answer
146 views

Error when using setOrgWideEmailAddressId in SingleEmailMessage [resolved]

I'm trying using setOrgWideEmailAddressId in my class Apex but he return this error: 718403274-125341 (195485361) Code: @AuraEnabled public static void sendEmailReference(String strEmail){ ...