Set up an email address in the cloud that applies a function to all messages it receives.

Make a Mail Receiver Function

Make a mail receiver function that responds to incoming email by sending a notification message:

  • MailReceiverFunction has access to a large number of email properties in addition to #From and #Subject.
  • By default, SendMail relays messages through the Wolfram Cloud, which requires you to have a Wolfram Cloud account.

Deploy the Mail Receiver Function to the Wolfram Cloud

When deployed to the Wolfram Cloud, the mail receiver function responds to email sent to the address in the CloudObject output:

Click for copyable input

Test the Deployed Mail Receiver Function

Test the mail receiver by clicking the receiver link in the preceding CloudDeploy output:

The Wolfram System opens your email client so that you can compose a message. Enter a subject and message and send the message:

Click for copyable input

The receiver sends a response:

Click for copyable input


You will not see the effect of a cloud-deployed MailReceiverFunction unless its argument produces an external effect via SendMail, CloudPut, Export or a similar function.
You can test a mail receiver function with an MBOX file. This responds to the first message in the file:
Click for copyable input
The receiver function sends an email message:
Click for copyable input