I am getting this error when writing email to my email service in my developer environment - using the email address I created the environment:

This message was created automatically by the mail system.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

>>> myemailservice@1tg6chj4oc8xpcatjre7pfdpa8bxwsuu9emdybfax2r7srgfba.9-p6epeaa.ap1.apex.salesforce.com (Undelivered): 554 The email service failed.

I checked the email service and the email address is added into both Email service and the email address' accepted email address list. I have also activated the email to Salesforce. I am now completely out of mind what is going wrong. It used to accept emails. I just updated my email service class and suddenly it stopped working. Any suggestions?

  • What have you done to your email service class? You may have inadvertently introduced a bug.
    – Kevin Lam
    May 6, 2014 at 5:56
  • The original version is just some dummy code using hard-coded values. I added some real code which deals with the email body, analysed the string and updated the database. You are right it might introduce some bugs since I haven't tested it (the email doesn't work). But it shouldn't cause the email deliverable, am I right?
    – Lance Shi
    May 6, 2014 at 6:00
  • I think the error is not about your email being undeliverable, it could be your email service class has failed.
    – Kevin Lam
    May 6, 2014 at 6:06
  • It shouldn't... Otherwise I should be able to see the error log at developer console, not by receiving an email back saying email not delivered.
    – Lance Shi
    May 6, 2014 at 6:08
  • 1
    I just tried with an email service class with an uncaught exception and got the same error as yours.
    – Kevin Lam
    May 6, 2014 at 8:52

1 Answer 1


I just tried with an email service class with an uncaught exception and got the same error as yours.

  • Thank you for the reply. I looked into the code and got an null exception error. I fixed it and solved the issue
    – Lance Shi
    May 6, 2014 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.