2014-12-05 3 views
0

사용자가 내 웹 사이트에 등록 할 때 확인 이메일을 보내려고합니다. 는 C#입니다mvc 5 SendEmailAsync with image

- 파일 시스템에서 내 ConfirmRegistration.html 파일을로드

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

. 그 파일은 -

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

입니다.하지만 로고가 나타나지 않습니다.

거기에 이미지를 표시하려면 특별한 조치가 필요합니까?

또한, 나는 당신이 절대 URL에 포함해야 SendEmailAsync

+1

절대 URL에 포함시켜야합니다. –

답변

1

계속 사용할 필요가있다.