我正在尝试将html文件文档作为邮件中的附件发送,但我的问题是,当我附加html文件时,似乎脚本标记在发送之前从html文件中删除。
protected void Button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
SmtpClient client = new SmtpClient("192.168.0.13");
mail.From = new MailAddress("test@email.com");
mail.To.Add("test@email.com");
mail.Subject = "Test email";
mail.IsBodyHtml = true;
mail.Body = "test email";
Attachment attachment = new Attachment("c:\\test.html");
mail.Attachments.Add(attachment);
client.Send(mail);
}
有没有办法发送html文件附件而不进行修改?