+ Start a Discussion
SandrineSandrine 

Debugging email services in salesforce

Hello,

I am working with email services,
Sometimes the email sending is not correct, receiptdoenst receive email or not attached to correct oject.

Howcani debug the issue ?

thank you for suggestions
Best Answer chosen by Sandrine
Raj VakatiRaj Vakati
Email Services can have several Email Addresses. Each Email Address has a context user (i.e. running user)

User-added image

You need to enable debug logging for that Context User. Well-designed email services do not use a specific individual as the Context user, rather, some dedicated headless user that serves as a traceability aid (as records will be created or modified using that context user and hence the audit fields become more useful)
Another possible answer is the email is sent from a domain not on the whitelist Accept Email from From. If you have set up the Email Service rules to Bounce the message rather than Discard, you gain additional insight as the sender will discover the problem.
And another debugging tool you have is the Email Snapshot feature available in Setup.

If everything is proper then debug log should appear.If debug log is not appearing you can check following points:
1. When you are replying to email, please make sure that replyto email id is same that you have added in replyto field on email addresses of email services.

Please make sure that you allowed all email addresses in 'Accept Email From' field of email service.

All Answers

Syed Insha Jawaid 2Syed Insha Jawaid 2
Hi Sandrine

Email Services contain several email addresses and each email address is associated with a 'context user'.So if yu set your debug log with that user you can generate them.

Another way is using the "Accept Email from From" field value.As emails are sent through domain not the whitelist < Accept Email from From> ,If the Email Service rules are set to 'Bounce' rather than 'Discard' a better view is visible to sender which will help in discovering the problem.

Cheers!!!!
Raj VakatiRaj Vakati
Email Services can have several Email Addresses. Each Email Address has a context user (i.e. running user)

User-added image

You need to enable debug logging for that Context User. Well-designed email services do not use a specific individual as the Context user, rather, some dedicated headless user that serves as a traceability aid (as records will be created or modified using that context user and hence the audit fields become more useful)
Another possible answer is the email is sent from a domain not on the whitelist Accept Email from From. If you have set up the Email Service rules to Bounce the message rather than Discard, you gain additional insight as the sender will discover the problem.
And another debugging tool you have is the Email Snapshot feature available in Setup.

If everything is proper then debug log should appear.If debug log is not appearing you can check following points:
1. When you are replying to email, please make sure that replyto email id is same that you have added in replyto field on email addresses of email services.

Please make sure that you allowed all email addresses in 'Accept Email From' field of email service.
This was selected as the best answer
Daniel BallingerDaniel Ballinger
Original source for the accept answer - Salesforce Email Service Debugging (https://salesforce.stackexchange.com/q/70821/102)