2

我正在尝试在 MVCMailer 中嵌入电子邮件图像。Github MvcMailer Step by Step Guide 确实提供了如下所示的解决方案:

分步指南:

//Place this in the View:
@Html.InlineImage("logo", "Company Logo")

//Place this in the mailer:
var resources = new Dictionary<string, string>();
resources["logo"] = logoPath;
PopulateBody(mailMessage, "WelcomeMessage", resources);

我的问题是,视图无法识别@Html.InlineImage. 它识别其他 html 助手,而不是“InlineImage”。事实上,当我输入@Html.

我认为这在 MVC 4 中不受支持。谁能指出我正确的方向并告诉我需要做什么才能使其正常工作?

4

2 回答 2

4

我知道为时已晚,但我解决了它添加“@using Mvc.Mailer;” 在电子邮件视图的顶部。

于 2014-02-14T08:15:52.090 回答
0

我没有弄清楚@Html.InlineImage 问题,但我确实找到了解决方法。简单地使用: <img style="width: 243px; height: 91px" src="cid:logo" alt="Logo"/>在我看来解决了这个问题。感谢大家寻求帮助。

于 2013-10-10T21:35:19.177 回答