使用 Lotuslive 凭据从 C# 代码发送邮件?

发布于 2024-12-18 03:03:34 字数 833 浏览 2 评论 0原文

我正在尝试使用 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)
            {

            }

I am trying to send mail from C# code using lotuslive smtp. But I have no success in sending the mail. everytime it says {"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."}.

My code is working fine for other email hosts like gmail and yahoo.

below is the code that I have used.

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)
            {

            }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

所谓喜欢 2024-12-25 03:03:34

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

如果是跟踪帐户则可能会导致一些问题。

    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;

如果您没有演示帐户,请检查此链接 - 如何在 Outlook 2003 中配置客户端
检查这些outlook 配置设置是否与您的代码设置匹配。

如果所有这些都不是问题,那么可能是您的邮件服务器有问题。检查这些链接以获取信息:
现有连接被 SMTP 中的远程主机强制关闭客户端
System.Net.Mail 使用 SSL 对端口 465 进行身份验证

Outgoing SSL SMTP Server: -smtp.mail.lotuslive.com (port: 465) Please
Note: Outgoing SMTP access for third party email clients is not
available for Trial accounts.

If it is trail account then may cause some problems.

    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;

If you do not have demo account then Check this link - How to configure client in Outlook 2003.
Check these outlook configure settings match to your code settings.

If all this stuff is not the issue then it may be problem at your mail server. Check these links for information:
An existing connection was forcibly closed by the remote host in SMTP client
System.Net.Mail with SSL to authenticate against port 465

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文