0
我正在將我的mvc 3.0項目更新到.net 4.0和mvc 4.0,並發現Fluent電子郵件停止工作。 我嘗試使用最新版本http://www.nuget.org/packages/fluent-email/1.2.2和預發行版本以及http://www.nuget.org/packages/fluent-email/1.3.0-RazorEngine流利的電子郵件錯誤無法編譯模板
但得到錯誤Unable to compile template
An exception of type 'RazorEngine.Templating.TemplateCompilationException' occurred in RazorEngine.dll but was not handled in user code
Additional information: Unable to compile template. Source file 'C:\Windows\TEMP\xrhyjmc5.0.cs' could not be found
可能有些人知道如何解決這個問題?
我的調用代碼:
email = Email
.From(model.FromEmail, model.Username)
.To(betsTipsterEmail)
.Subject(emailSubject)
.UsingTemplateFromFile(emailBodyFile, model)
.Body(model.Body)
.UsingClient(client);
我Confirmation.html
模板:
<html>
<body>
<p>
Hi @Model.Username,
bla<br /><br />
bla<br /><br />
<a href="@Model.Url">@Model.Url</a><br /><br />
bla
</p>
<p>
Kind Regards,<br /><br />
bla
</p>
</body>
</html>
RazorEngine版本3.2.0 一直在尋找到這篇文章http://www.britishdeveloper.co.uk/2011/07/razorengine-templatecompilationexceptio.html但並沒有幫助