【发布时间】:2015-11-10 17:07:09
【问题描述】:
我有一个使用 Razor 语法的脚本,它在处理客户的订单后向客户发送确认信息。可以附加各种 PDF,具体取决于它们的顺序。
使用 Microsoft 建议的代码附加 PDF 没有问题:
var filesList = new string[] { InsuranceIndemnityPath, tourPDFPath };
WebMail.Send(
to: email,
from: "me@domain.com",
isBodyHtml: true,
subject: "Your Booking",
body: header + body + entry + footer,
filesToAttach: filesList
);
但是,附件带有完整的相对路径,例如在我的电子邮件中,附件类似于“Docs/2015/11/InsuranceIndemnity.pdf”
我已经对此进行了搜索,到目前为止,关于如何为附加文档提供合理的文件名仍是一片空白。很抱歉,如果这是显而易见的,非常感谢。
【问题讨论】:
标签: asp.net razor email-attachments webmail