【问题标题】:SMTP not able to send group mailSMTP 无法发送群组邮件
【发布时间】:2013-11-22 20:24:03
【问题描述】:

作为批处理作业的一部分,我需要发送群邮件。我正在使用 javax.mail 包来完成此操作。

        Properties m_properties;
        m_properties = new Properties();
        m_properties.put("mail.smtp.host", "localhost");
        m_properties.put("mail.smtp.port", Integer.toString(26));

        Session m_Session = Session.getDefaultInstance(m_properties);

        Message m_simpleMessage = new MimeMessage(m_Session);
        InternetAddress m_fromAddress = new InternetAddress("me@sample.com");
        InternetAddress m_toAddress = new InternetAddress("group@sample.com");
        m_simpleMessage.setFrom(m_fromAddress);
        m_simpleMessage.setRecipient(RecipientType.TO, m_toAddress);
        m_simpleMessage.setSubject(m_subject);
        m_simpleMessage.setContent(m_body, "text/html");

        Transport.send(m_simpleMessage);

我正在使用 Windows 服务器。我安装了 IIS SMPT 服务器并使用它。当我向个人 ID 发送邮件时,我没有问题。但是在尝试发送到群组时出现错误。

错误:

这是一个自动生成的交付状态通知。 传递到下列收件人失败。 group@sample.com

我是否需要在我的 SMPT 服务器中为群组配置某些内容,或者我是否需要更改我的代码以允许发送群组邮件。

【问题讨论】:

  • 这很可能是 SMTP 服务器的问题。 JavaMail 不知道也不关心电子邮件地址是针对单个用户还是针对分发列表(组)的。
  • 我是否需要配置 SMTP 以便它知道组信息。如果是这样,我可以在哪里做。
  • 可能想问serverfault.com

标签: java smtp windows-server-2008


【解决方案1】:

该组必须存在于目标服务器中...您访问的目标 smtp 服务器是否包含该组?

【讨论】:

  • 目标服务器中存在组。我可以通过 Outlook 手动发送测试邮件。但是,唯一的问题是当我从我的 java 程序中进行操作时。事实上,我正在运行的 Windows 服务器正在发送传递失败消息。
猜你喜欢
  • 1970-01-01
  • 2018-02-24
  • 2022-07-20
  • 2019-01-23
  • 2022-01-06
  • 2017-02-15
  • 2014-09-13
  • 2020-03-02
  • 1970-01-01
相关资源
最近更新 更多