1

你好我用这个代码发送一封电子邮件

Process.Start("mailto:" + Email + "?subject=Contact" + "&body=" + bodymesssage);

在我的电脑中正常工作,但在服务器中在客户端抛出此错误:

未捕获的 Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:没有足够的存储空间来完成此操作

这是缺少配置吗?谢谢!

4

1 回答 1

0

改用这个:

public static void SendMessage(String server, String[] emails, String subject, String body)
{
    MailMessage message = new MailMessage(m_Sender, String.Join(",", emails), subject, body);

    SmtpClient client = new SmtpClient(smtpServer);
    client.Credentials = CredentialCache.DefaultNetworkCredentials;

    try { client.Send(message); }
    catch (Exception ex) { Console.WriteLine("ERROR!"); }
}
于 2013-01-20T01:25:16.673 回答