我正在尝试MvcMailer
用于在我的 MVC3 应用程序中发送电子邮件。
我已经成功安装了这个包MvcMailer
。
使用参考无法安装 MvcMailer并按照步骤操作
但是在使用的时候出现了错误。
using Mvc.Mailer;
The type or namespace name 'MailerBase' could not be found (are you missing a using directive or an assembly reference?)
我在下面的代码中提到错误作为注释。
using Mvc.Mailer; //The type or namespace name 'Mvc' could not be found (are you missing a using directive or an assembly reference?)
namespace MvcApplicationMvcMailer.Mailers
{
public class UserMailer : MailerBase, IUserMailer //The type or namespace name 'MailerBase' could not be found (are you missing a using directive or an assembly reference?)
{
public UserMailer()
{
MasterName="_Layout";
}
public virtual MvcMailMessage Welcome()
{
//ViewBag.Data = someObject;
return Populate(x =>
{
x.Subject = "Welcome";
x.ViewName = "Welcome";
x.To.Add("some-email@example.com");
});
}
public virtual MvcMailMessage GoodBye()
{
//ViewBag.Data = someObject;
return Populate(x =>
{
x.Subject = "GoodBye";
x.ViewName = "GoodBye";
x.To.Add("some-email@example.com");
});
}
}
}