1

我正在使用 sieve 发送有关我们内部电子邮件的外部通知电子邮件。

if header :matches "X-Forward-To" "*" {
   set "forwardTo" "${1}";
   set :encodeurl "message" "Message";
   notify :from "no-reply@mycompany.com"
     :importance "1"
     :message "You've got mail!"
     "mailto:${forwardTo}?body=${message}";
   }
}

在消息中有任何 html 标记之前,这非常有效。然后我收到带有写出标签的纯文本电子邮件。除了 之外,我还可以使用其他功能notify吗?有开关notify吗?如何使用 sieve 发送 HTML 电子邮件?

编辑:要清楚,我不只是想重定向或转发初始消息;我想发送带有自己消息的通知。

编辑 2: 看起来它可能只是在干扰我的邮件交换服务器。该content-type: text/html标签可能会以其他方式工作。

4

1 回答 1

1

如果它可以正常工作,您需要在 mailto URL 中包含 Content-Type 标头,如下所示:

set :encodeurl "message" "Message <i>with HTML</i>";
notify :from "no-reply@mycompany.com"
  :importance "1"
  :message "You've got mail!"
  "mailto:${forwardTo}?Content-Type=text/html&body=${message}";

如果您在这样做时遇到问题,那么您的邮件设置或途中的邮件服务器可能不会处理通过通知发送 HTML 电子邮件。

于 2017-05-24T00:05:37.007 回答