The two steps for configuring Force.com to process inbound emails are as follows:
1. Write an Apex class that implements a specific interface (
Messaging.InboundEmailHandler) and method (
handleInboundEmail). This provides your code access to the envelope (
Messaging.InboundEnvelope) and content (
Messaging.InboundEmail) of inbound emails, including mail headers and attachments. It is otherwise standard Apex code with no special restrictions. The return value of this method is a
Messaging.InboundEmailResult. To indicate processing failure, set the
success field of this object to
false. Any explanatory message set in the
message field is returned to the sender as an email response.
2. Create an Email Service using the native user interface. ...