[英]mvc 5 SendEmailAsync with image
I am trying to send a confirm email when a user registers on my website. 当用户在我的网站上注册时,我试图发送一封确认电子邮件。
The C# is - C#是-
string baseDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
string confirmRegistrationEmail = System.IO.File.ReadAllText(baseDirectory + "Content\\ConfirmRegistration.html").Replace("#logo", baseDirectory + "Content\\Images\\logo.png");
await UserManager.SendEmailAsync(_user.Id, "Confirm your account", confirmRegistrationEmail);
which loads my ConfirmRegistration.html file from the file system. 从文件系统加载我的ConfirmRegistration.html文件。 That file is -
该文件是-
<html>
<body>
<img src="#logo" alt="Logo" align="middle">
<br>
<b>Thank you for registering with Example Website.</b> Your account has been created.<br>
<p align ="justify"> <a href="#callbackURL">Click here to confirm and complete the registration process.</a></p>
</body>
</html>
But I can't get the logo to appear. 但是我无法显示徽标。
IS there something special I need to do to get that image to appear? 我需要做些特别的事情才能使该图像出现吗?
Also, I need to continue to use SendEmailAsync
另外,我需要继续使用
SendEmailAsync
您必须将其包含在绝对网址中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.