Wolfram Language

Channel Framework

Process Incoming Email

Set up a listener that speaks the subject of an incoming message.

In[1]:=
Click for copyable input
listener = ChannelListen["mailSpeak", Speak["From " <> #Message["from"] <> ", message: " <> #Message["msg"]] &, Permissions -> <|"Owner" -> {"Read", "Execute"}, "All" -> "Write"|>]
Out[1]=

Create a MailReceiverFunction that forwards received mail to your listener.

In[2]:=
Click for copyable input
MailReceiverFunction[With[{user = $WolframID}, ChannelSend[ user <> ":" <> "mailSpeak", <|"msg" -> #Subject, "from" -> #From|>] &]] // CloudDeploy
Out[2]=

Send an email to the receiver function and hear your listener speak.

In[3]:=
Click for copyable input
SendMail[<|"To" -> "receiver+d98iMkU6@wolframcloud.com", "Subject" -> "Hello There"|>];

Related Examples

de es fr ja ko pt-br ru zh