I have an html template, and I have used the below image & source, but the template is displaying properly, but the image is not displayed in others system but visible in my local system, Where I did go wrong? And I have tried with base64 format but outlook is not supporting the base64 format. So is there any other option to solve this problm ?
My same Html img src,
<img src="localhost:65432\appcore\content\images\logo.png />
And my server side code to send mail,
...
using (var client = new WebClient())
{
string reader = client.DownloadString(templatePath);
StringBuilder sb = new StringBuilder();
sb.Append(reader);
sb.Replace("<MessageBody>", email.Body);
Messagebody = sb.ToString();
}
message = new MailMessage(
"InEight.Mail@ineight.com", // not implemented/supported
by SMTP server: email.From,
(email.To ?? "").Replace(";", ","), email.Subject,
((email.IsBodyHtml == true) ?
HttpUtility.HtmlDecode(Messagebody.Replace(@"\r\n", Environment.NewLine))
: Messagebody))
{
IsBodyHtml = email.IsBodyHtml
};
var mailer = new SmtpClient
{
Host = RuntimeConfig.SMTP.Host,
Credentials = new
System.Net.NetworkCredential(RuntimeConfig.SMTP.Username,
RuntimeConfig.SMTP.Password),
Port = RuntimeConfig.SMTP.Port,
EnableSsl = RuntimeConfig.SMTP.EnableSsl,
Timeout = PlatformServiceConstants.SMTPTimeOut
};
mailer.Send(message);
email.IsSent = true;
email.SentOn = DateTime.UtcNow;
...