我究竟如何以及在何处放置字符串的实际文件位置attachmentPath
:
public virtual MailMessage Welcome(string attachmentPath)
{
var mailMessage = new MailMessage{Subject = "Welcome to MvcMailer"};
...
mailMessage.Attachments.Add(new Attachment(attachmentPath));
PopulateBody(mailMessage, "Welcome");
return mailMessage;
}
假定服务器上的物理文件位置c:\inetpub\server\website\docs\test.pdf