My emails through salesforce force flow are failing
I’m working on a requirement when a new lead is assigned, I want to send an automated email that your lead is generated …. But the thing is I’m using my company’s domain in From address and I can’t send email to Outlook/Google
The reason for the email failure is that DMARC policy fails and DKIM keys errors, I’ve researched this a lot but haven’t been able to figure it out, configured it almost 3-4 times still not able to get it.
Has anyone faced this before and if yes how did you make it work ? I believe the issue is with the receivers email domain as it’s not accepting or I’ve been getting it wrong all the time.
When I send a test email to my outlook/gmail accounts it works perfectly fine but when I’m doing this through apex/flow it’s failing.
Posted Mar 17, 2023, 1:37 AM UTC
OP you need to create a DKIM key for your org and add it to your DNS so emails from Salesforce don't fail.
Check this page with DKIM Best Practices in Salesforce https://help.salesforce.com/s/articleView?id=000381186&type=1
Thank you so much , I have been looking at it but thanks for reassurance , I will talk with my IT support team and see how to implement.
Awesome!! It definitely helped when I was in your situation, cheers
Hey bud,
That worked like magic , I gave this to my IT team, they updated the config and it worked. Yay!! Appreciate it. Also I am putting some chatgpt help which I took for your reference:
Resolving DMARC policy conflicts when sending emails from Salesforce (company domain) to Gmail involves ensuring that the email is properly authenticated and complies with the recipient's DMARC policy. Here are the steps you can take:
1- Ensure that your company's domain is properly configured for DMARC authentication. This involves setting up SPF (Sender Policy Framework) and/or DKIM (DomainKeys Identified Mail) records for your domain. You can work with your IT department or email service provider to ensure that your domain is properly configured.
2- Check the DMARC policy of the recipient's domain (in this case, Gmail). You can do this by sending an email to a Gmail address and checking the headers of the received email for DMARC information.
3- If the recipient's DMARC policy is set to "reject" or "quarantine," you may need to modify your email content to comply with their policy. For example, you may need to ensure that the "From" address in your email matches the domain used in your SPF and DKIM records.
4- Consider using a third-party email service provider that supports DMARC authentication. Many email service providers offer DMARC-compliant email delivery services that can help ensure that your emails are properly authenticated and comply with the recipient's DMARC policy.
5- If you continue to experience issues, you may need to work with the recipient's IT department to resolve the DMARC policy conflict. They may be able to adjust their policy to allow your emails to be delivered or provide guidance on how to ensure compliance with their policy.
#2 :
I can guide you through the process of resolving DMARC policy for Salesforce email in text format. You can follow these steps:
Create a subdomain for Salesforce email: To use a custom domain for Salesforce emails, you'll need to create a subdomain (e.g., sfdc.yourdomain.com). This subdomain will be used for sending emails on behalf of your main domain.
Update DNS records: In your DNS provider, create the necessary DNS records for the subdomain you created in step 1. The records should include:
a. SPF: Sender Policy Framework (SPF) is used to specify which IP addresses or hosts are allowed to send emails on behalf of your domain. For Salesforce, you'll need to add their SPF record to your subdomain. It should look like this:
v=spf1 include:_spf.salesforce.com ~all
b. DKIM: DomainKeys Identified Mail (DKIM) is an email authentication method that verifies the email was sent by an authorized mail server. Salesforce provides a DKIM key that you can use to sign your emails. To generate the key, follow these steps:
i. Go to Salesforce Setup. ii. Search for "DKIM" in the Quick Find box. iii. Click "New DKIM Key." iv. Enter the selector and domain details, then save.
After generating the key, you'll get a TXT record value. Add this record to your DNS for the subdomain you created.
c. DMARC: Domain-based Message Authentication, Reporting, and Conformance (DMARC) is a policy that specifies how your domain handles unauthenticated emails. To create a DMARC record, add a TXT record for your main domain with the following format:
_dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:your@email.com; ruf=mailto:your@email.com"
Replace "your@email.com" with your actual email address for receiving DMARC reports.
Configure Salesforce Email Relay: After setting up the DNS records, configure Salesforce to use the subdomain for sending emails. To do this, follow these steps:
a. Go to Salesforce Setup. b. Search for "Email Relay" in the Quick Find box. c. Click "Email Relay Activation." d. Enable the Email Relay. e. Click "New Email Relay" and enter the required information, such as the relay server hostname and port. f. Save the changes.
Update Salesforce email settings: Finally, update the Salesforce email settings to use the subdomain you created in step 1. Go to Salesforce Setup, search for "Deliverability" in the Quick Find box, and update the "Email Security Compliance" section with your subdomain information.
By following these steps, you should be able to resolve DMARC policy issues for Salesforce email.