有没有办法自动回复特定消息。这里的过程是您通过例如发出请求。Outlook,然后回复您提出的请求的响应。
问问题
187 次
1 回答
0
是的,您让您的应用程序使用 POP3 或 IMAP 定期检查收件箱中的邮件,并在有与您的请求格式匹配的邮件时执行某些操作。
类似的东西(实际上不是一个工作示例,更像是伪代码)
mail=Mail.login(:server => 'foo',
:user => 'john',
:password => 'john_is_the_king_pimp'
)
while 1==1
mail.new_messages do |msg|
if msg.subject.match(/^REQUEST/)
read stuff from the message and do something about it
end
end
sleep 60
end
于 2011-08-24T01:04:59.953 回答