0

以下代码在本地运行良好,但是当我将其发布到服务器时,出现错误 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);
        }
4

1 回答 1

0

谢谢你。VS 2012 中的发布没有添加 helper.dll。添加它,现在可以工作了!感谢所有的建议。

于 2013-03-04T22:37:47.240 回答