I need to send an email with an attachment in MVC3
i have send mail code but how can i attach file in MVC3 and send a mail
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);
}