【问题标题】:Send mail from C# code using lotuslive credentials?使用 lotuslive 凭据从 C# 代码发送邮件?
【发布时间】:2012-01-07 16:23:39
【问题描述】:

我正在尝试使用 lotuslive smtp 从 C# 代码发送邮件。但是我没有成功发送邮件。每次它说{“无法从传输连接读取数据:现有连接被远程主机强行关闭。”}

我的代码在 gmail 和 yahoo 等其他电子邮件主机上运行良好。

下面是我用过的代码。

MailMessage message = new MailMessage();
    message.From = new MailAddress("fromaddress");
    message.To.Add(new MailAddress("toaddress"));

    message.Subject = "Test";
    message.Body = "test";

    SmtpClient client = new SmtpClient("companyname-com-smtp.mail.lotuslive.com", 465);
    client.UseDefaultCredentials = false;

    NetworkCredential credential = new NetworkCredential("companycredentials", "password");

    client.Credentials = credential;


    client.EnableSsl = true;
           try
            {
                client.Send(message);
            }
            catch(Exception ex)
            {

            }

【问题讨论】:

    标签: c# smtp sendmail lotus


    【解决方案1】:

    传出 SSL SMTP 服务器:-smtp.mail.lotuslive.com(端口:465)请 注意:第三方电子邮件客户端的传出 SMTP 访问不是 可用于试用帐户。

    如果是trail账号,可能会出现一些问题。

        MailClient = new SmtpClient();
        MailClient.Host = "smtp.mail.lotuslive.com/your host address";
        MailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
        MailClient.Credentials = new System.Net.NetworkCredential(username, password);
        MailClient.EnableSsl = true;
        MailClient.Port = 465;
    

    如果您没有模拟账户,请查看此链接 - How to configure client in Outlook 2003
    检查这些outlook configure settings 是否与您的代码设置匹配。

    如果所有这些都不是问题,那么它可能是您的邮件服务器的问题。检查这些链接以获取信息: An existing connection was forcibly closed by the remote host in SMTP client
    System.Net.Mail with SSL to authenticate against port 465

    【讨论】:

    • 感谢 Niranjan,我之前已经尝试过所有这些链接。虽然我得到的实际解决方案来自以下链接stackoverflow.com/questions/1082216/…
    • 那么问题解决了吗?如果没有,您使用的是测试帐户吗?
    猜你喜欢
    • 1970-01-01
    • 2011-09-26
    • 1970-01-01
    • 1970-01-01
    • 2019-04-17
    • 2013-06-22
    • 1970-01-01
    • 1970-01-01
    • 2020-06-30
    相关资源
    最近更新 更多