无法从传输连接中读取数据:net_io_connectionclosed smtp.office365.com
我有一个由Microsoft Visual Studio 2008开发的Windows应用程序桌面(C#)。该应用程序将SMTPCLEINT用于系统生成的电子邮件服务。 SMTP.Office365.com通过电子邮件地址使用的电子邮件服务。它运行良好,但最近表现出一个例外。
无法从传输连接中读取数据:net_io_connectionclosed。
我试图解决几天,但不可能。
代码:
dt_email = dh.select_table("Select * from dbo.tblEmailInfo");
try
{
MailMessage mM = new MailMessage();
mM.From = new MailAddress(dt_email.Rows[0][1].ToString());
mM.To.Add(this.dgvAction.CurrentRow.Cells[23].Value.ToString());
mM.CC.Add(dt_email.Rows[0][1].ToString());
mM.Subject = "Leave Adjustment";
mM.Body = get_boy(e.RowIndex, adjust, dt_email.Rows[0][4].ToString(), remarks);
mM.IsBodyHtml = true;
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new System.Net.NetworkCredential(dt_email.Rows[0][1].ToString(), dt_email.Rows[0][2].ToString());//Provide yoyr gmail credentials email and password
SmtpServer.Port = 587;
SmtpServer.EnableSsl = true;
SmtpServer.Host = dt_email.Rows[0][3].ToString();
SmtpServer.Send(mM);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
MessageBox.Show("Email Notification has been successfully sent.");
如何解决此异常。
I have a windows application desktop-based(C#) developed long days ago by Microsoft Visual Studio 2008. This application used SmtpClient for system-generated email services. smtp.office365.com email service used for from email address. It's working very well but recently shown an exception.
Unable to read data from the transport connection: net_io_connectionclosed.
I am trying to solve it for a few days but not possible.
Code:
dt_email = dh.select_table("Select * from dbo.tblEmailInfo");
try
{
MailMessage mM = new MailMessage();
mM.From = new MailAddress(dt_email.Rows[0][1].ToString());
mM.To.Add(this.dgvAction.CurrentRow.Cells[23].Value.ToString());
mM.CC.Add(dt_email.Rows[0][1].ToString());
mM.Subject = "Leave Adjustment";
mM.Body = get_boy(e.RowIndex, adjust, dt_email.Rows[0][4].ToString(), remarks);
mM.IsBodyHtml = true;
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new System.Net.NetworkCredential(dt_email.Rows[0][1].ToString(), dt_email.Rows[0][2].ToString());//Provide yoyr gmail credentials email and password
SmtpServer.Port = 587;
SmtpServer.EnableSsl = true;
SmtpServer.Host = dt_email.Rows[0][3].ToString();
SmtpServer.Send(mM);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
MessageBox.Show("Email Notification has been successfully sent.");
How to solve this exception.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了完全相同的问题,您需要将其放在一开始:
I've had the exact same issue, you need to put this in the beginning: