处理接收的邮件
设置一个播放接收的邮件主题的侦听器.
In[1]:=
listener =
ChannelListen["mailSpeak",
Speak["From " <> #Message["from"] <>
", message: " <> #Message["msg"]] &,
Permissions -> <|"Owner" -> {"Read", "Execute"}, "All" -> "Write"|>]
Out[1]=
创建一个 MailReceiverFunction 将接收到的邮件转发给侦听器.
In[2]:=
MailReceiverFunction[With[{user = $WolframID},
ChannelSend[
user <> ":" <> "mailSpeak", <|"msg" -> #Subject,
"from" -> #From|>] &]] // CloudDeploy
向接收器函数发送一封邮件并听取侦听器播放.
In[3]:=
SendMail[<|"To" -> "receiver+d98iMkU6@wolframcloud.com",
"Subject" -> "Hello There"|>];