我需要在 MVC3 中发送带有附件的电子邮件
我有发送邮件代码,但是如何在 MVC3 中附加文件并发送邮件
public void SendConfirmationEmail(string file)
{
string verifyUrl = //need to send that file URL code saving that file
//on server drive
var message = new MailMessage("YOUR_USER_ACCOUNT_HERE@YOUR_DOMAIN_HERE", "SENDERS EMAIL ID")
{
Subject = "Please confirm attachment",
Body = verifyUrl
//Also send attachment file code
};
var client = new SmtpClient();
client.Send(message);
}