我有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 发送。请问如何正确调用这个类?