我得到的错误,当我尝试发送电子邮件:在VB传送电子邮件与ActionMailer.Mvc,找不到查看
Return Email("~/Views/Email/VerificationEmail.html.vbhtml", model)
可以:
NoViewsFoundException
You must provide a view for this email. Views should be named ~/Views/Email/VerificationEmail.html.vbhtml.txt.cshtml or ~/Views/Email/VerificationEmail.html.vbhtml.html.cshtml (or aspx for WebFormsViewEngine) depending on the format you wish to render.
上线错误电子邮件不会以.vbhtml发送,它们必须以.cshtml发送吗?这对VB如何工作?
这里是我的代码控制器:
Imports ActionMailer.Net.Mvc
Public Class EmailController
Inherits MailerBase
Public Function VerificationEmail(ByVal model As RegisterModel) As EmailResult
[To].Add(model.Email)
From = "[email protected]"
Subject = "Thanks for registering with us!"
Return Email("~/Views/Email/VerificationEmail.html.vbhtml", model)
End Function
End Class
这是我的观点:
@modelType MyBlog.RegisterModel
@Code
Layout = Nothing
End code
Welcome to My Cool Site, @Model.UserName
We need you to verify your email. Click this nifty link to get verified!
@Html.ActionLink("Verify", "Account", New With {.code = Model.Email})
Thanks!
我改变你的代码,但我仍然得到错误:'你必须提供此电子邮件的视图。根据您想要渲染的格式,视图应该被命名为〜/ Views/Email/VerificationEmail.txt.cshtml或〜/ Views/Email/VerificationEmail.html.cshtml(或aspx for WebFormsViewEngine)。 – user1477388
您可以帮忙吗?我必须删除并重新发布更多信息吗?谢谢。 – user1477388
@ user1477388我已经设法重制你的问题,在ActionMailer中肯定有错误...没有必要删除你的问题,这很好。如果我找到了某些东西,我会更新我的答案。 – nemesv