[英]How send HTML responsive e-mail?
I'm new to html and css. 我是html和CSS的新手。 Earlier I made responsive e-mail using Ink framework
. 之前,我使用Ink framework
发送响应式电子邮件。 Now I want to send this e-mail but I don't know how. 现在,我想发送此电子邮件,但我不知道如何发送。
I don't want to use Mailchimp
etc. 我不想使用Mailchimp
等
I actually use ASP C# to send my emails now, with something that looks like : 实际上,我现在使用ASP C#发送电子邮件,内容类似于:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Form.Count > 0)
{
string formEmail = "";
string fromEmail = "from@email.com";
string defaultEmail = "default@email.com";
string sendTo1 = "";
int x = 0;
for (int i = 0; i < Request.Form.Keys.Count; i++)
{
formEmail += "<strong>" + Request.Form.Keys[i] + "</strong>";
formEmail += ": " + Request.Form[i] + "<br/>";
if (Request.Form.Keys[i] == "Email")
{
if (Request.Form[i].ToString() != string.Empty)
{
fromEmail = Request.Form[i].ToString();
}
formEmail += "<br/>";
}
}
System.Net.Mail.MailMessage myMsg = new System.Net.Mail.MailMessage();
SmtpClient smtpClient = new SmtpClient();
try
{
myMsg.To.Add(new System.Net.Mail.MailAddress(defaultEmail));
myMsg.IsBodyHtml = true;
myMsg.Body = formEmail;
myMsg.From = new System.Net.Mail.MailAddress(fromEmail);
myMsg.Subject = "Sent using Gmail Smtp";
smtpClient.Host = "smtp.gmail.com";
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = true;
smtpClient.Credentials = new System.Net.NetworkCredential("testing@gmail.com", "pward");
smtpClient.Send(defaultEmail, sendTo1, "Sent using gmail smpt", formEmail);
}
catch (Exception ee)
{
debug.Text += ee.Message;
}
}
}
This is an example using gmail as the smtp mail sender. 这是使用gmail作为smtp邮件发件人的示例。 Some of what is in here isn't needed, but it is how I use it, as I am sure there are more effective ways in the same fashion. 这里不需要某些内容,但是它是我的使用方式,因为我敢肯定,以相同的方式有更有效的方法。
Or see the demo pages 或查看演示页面
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.