簡體   English   中英

MVC 5 SendEmailAsync與圖像

[英]mvc 5 SendEmailAsync with image

當用戶在我的網站上注冊時,我試圖發送一封確認電子郵件。

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);

從文件系統加載我的ConfirmRegistration.html文件。 該文件是-

<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>

但是我無法顯示徽標。

我需要做些特別的事情才能使該圖像出現嗎?

另外,我需要繼續使用SendEmailAsync

您必須將其包含在絕對網址中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM