以下代码在本地运行良好,但是当我将其发布到服务器时,出现错误 The name 'WebMail' does not exist in the current context。不知道为什么会发生这种情况,特别是如果它在本地工作。谢谢你的帮助。
public void SendMessage()
{
WebMail.SmtpServer = SmtpServer;
WebMail.UserName = ServerUsername;
WebMail.Password = ServerPassword;
WebMail.From = this.From;
var recipents = string.Join(",", this.To);
WebMail.Send(recipents, this.Subject, this.Body);
}