【问题标题】:opa : sending mailopa : 发送邮件
【发布时间】:2012-09-03 06:58:41
【问题描述】:

我正在尝试使用 SmtpClient.try_send() 发送电子邮件。此代码用于在 opa 切换到 node.js 后端之前工作:

import stdlib.web.mail.smtp.client
import stdlib.web.mail

function start()
{
        Email.email from = {name:some("name"), address:{local:"contact", domain:"hello.com"}}
        Email.email to = {name:some("name"), address:{local:"contact", domain:"hello.com"}}
        Email.content content = {text : "This is Great!"}
        SmtpClient.try_send(from, to, "subject",content, Email.default_options)
        <>Hello</>
}

Server.start(
   {port:8092, netmask:0.0.0.0, encryption: {no_encryption}, name:"test"},
   [
     {page: start, title: "test" }
   ]
)

但现在它失败并出现以下错误:

Test serving on http://ks3098156.kimsufi.com:8092

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: write EPIPE
    at errnoException (net.js:646:11)
    at Object.afterWrite [as oncomplete] (net.js:480:18)

怎么了?

谢谢,

【问题讨论】:

  • 您使用的是哪个版本的节点?可以在消息中添加标签 node.js 吗?

标签: email opa


【解决方案1】:

你可以试试:

SmtpClient.try_send(from, to, "subject", content, { Email.default_options with to:[to] })

【讨论】:

  • 就是这样!我的系统上没有安装 sendmail。谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-31
  • 2021-03-28
  • 2014-04-14
  • 2016-02-12
  • 2017-02-09
  • 2012-08-24
相关资源
最近更新 更多