我试图给出这样的电子邮件外观:
This is the looks of my email
电子邮件主题的右侧是 Ignou 徽标,它是 jpg 图像。我有以下发送电子邮件的类,它工作正常:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Net.Configuration;
using System.Net.Mail;
namespace ProductManagementweb.HelperClasses
{
public class SendEmail
{
public static int SendMail(string ReceiverAddress, string Recsubject, string Recbody)
{
try
{
System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
MailSettingsSectionGroup settings = (MailSettingsSectionGroup)config.GetSectionGroup("system.net/mailSettings");
System.Net.NetworkCredential credential = new System.Net.NetworkCredential(settings.Smtp.Network.UserName, settings.Smtp.Network.Password);
//Create the SMTP Client
SmtpClient client = new SmtpClient();
client.Host = settings.Smtp.Network.Host;
client.Credentials = credential;
client.Timeout = 30000;
client.EnableSsl = true;
MailMessage mm = new MailMessage();
mm.From = new MailAddress(settings.Smtp.Network.UserName, "Support Team (Clique City)");
mm.To.Add(ReceiverAddress);
mm.Priority = MailPriority.High;
// Assign the MailMessage's properties
mm.Subject = Recsubject;
mm.Body = Recbody;
mm.IsBodyHtml = false;
client.Send(mm);
return 1;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
我怎样才能像上面的图片一样提供电子邮件格式,我确信我必须使用 html 标签来提及格式,但我不知道我必须在哪里提及以及如何提及。因此,任何帮助都将不胜感激。