原始文档存在于此处。
我已经转换了控制器动作:
Imports ActionMailer.Net.Mvc
Public Class EmailController
Inherits MailerBase
Public Function VerificationEmail(ByVal model As RegisterModel) As EmailResult
[To].Add(model.Email)
From = "me@my.org"
Subject = "Thanks for registering with us!"
Return Email("VerificationModel", model)
End Function
End Class
并且,视图(EmailVerification.html.vbhtml
):
@modelType GemcoBlog.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!
但是,如何将此 C# 代码转换为从我的 Register 方法调用函数到 VB?
new MailController().VerificationEmail(newUser).Deliver();
我在互联网上没有找到任何描述如何在 VB 中执行此操作的内容,所以也许这篇文章会对那些寻找的人有所帮助。
作为旁注:有人可以向我解释一下这种语法[To].Add(model.Email)
吗?我以前没见过。谢谢。