我是 REBOL 的新手。人们在博客上谈论如何使用 REBOL 发送电子邮件作为例子,类似于“发送”文档中的这个例子:
send luke@rebol.com "Testing REBOL Function Summary"
阅读了这样做是多么简单和方便之后,我兴奋地尝试通过我的 GMail 帐户向自己发送一封测试电子邮件。
我查看了 SMTP/POP 的官方 GMail 帮助以获取相关的 SMTP/POP 服务器名称: https://support.google.com/mail/answer/7104828?hl=en
下面是“send”和“set-net”文档对我的帮助:
>> set-net [ myrealusername@gmail.com smtp.gmail.com pop.gmail.com ]
>> send myrealusername@gmail.com "Hello me!"
connecting to: smtp.gmail.com
** Access Error: Cannot connect to smtp.gmail.com
** Where: open-proto
** Near: smtp-port: open [scheme: 'esmtp]
either only
仔细一想,当然不行;我没有告诉 REBOL 要使用 SSL/TLS、相关端口号或我的 GMail 密码。它必须具备以上所有条件才能真正发送电子邮件。
那我该怎么做呢?
最佳答案
我修改了 protocols几年前使用 gmail。我希望它们仍然有效。
您需要运行 prot-ssmtp.r 和 prot-ssend.r,并且需要支持 ssl 的 rebol2 版本。这可以是免费的 View 构建,也可以是付费的核心构建。
do https://raw.githubusercontent.com/gchiu/Rebol2/master/Protocols/prot-ssmtp.r
do https://raw.githubusercontent.com/gchiu/Rebol2/master/Protocols/prot-ssend.r
现在,您可以手动设置用户和密码:
system/schemes/esmtp/user: "username"
system/schemes/esmtp/pass: "password"
或者,当脚本第一次运行时,系统会询问您这些值,以便为该 rebol 实例设置它们。 prot-ssmtp 使用端口 465,但如果它不再正确,您可以修改它。
然后在设置 set-net 之后它应该是直截了当的:
ssend email@someon.com "This is my message"
关于gmail - 在 REBOL 2 中通过 GMail SMTP 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42870202/