我有MailManager
它有公共方法,如:
public MailMessage ConfirmationEmail(CommonTicketEmailViewModel viewModel)
{
var template = ReadTemplate("ConfirmationEmail.cshtml");
string result = Razor.Parse(template, new { ConfirmationUrl = viewModel.Url, Token = viewModel.Code });
var mailMessage = new MailMessage();
mailMessage.Subject = "Confirmation E-mail";
mailMessage.Body = result;
mailMessage.IsBodyHtml = true;
mailMessage.To.Add(viewModel.ToEmail);
return mailMessage;
}
这个类只是准备MailMessage发送。请问这个班有多正确?
答案 0 :(得分:0)
MailMessageUtilities
或MailMessageFactory
怎么样?