我曾经在asp.net(使用c#代码)发送电子邮件
我曾经在aspx页面中设计表单,并用于在aspx.cs页面中编写coading,如
string mailto;
string mailfrom;
string name;
string subject;
string message;
string MailContent;
string cc;
SmtpClient client;
System.Net.Mail.MailMessage msg;
client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("noreply@gmail.com", "password");
client.Port = 587;//25
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
mailto ="abc@gmail.com";
mailfrom = "noreply@gmail.com";
name = "name";
subject = "subject";
message ="hi";
msg = new System.Net.Mail.MailMessage();
msg.To.Add(mailto);
//msg.To.Add(cc);
msg.From = new MailAddress(mailfrom, name, System.Text.Encoding.UTF8);
msg.Subject = subject;
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = message;
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
try
{
client.Send(msg);
MailStatus = true;
}
catch (Exception ex)
{
ex.ToString();
MailStatus = false;
}
但是我想从简单的.html页面发送邮件,类似于上面.aspx页面中所做的那样?
是否有任何javascript或css或dll文件可用于发送电子邮件?