C# 使用javascript和C发送邮件时出错#
我正在使用下面的代码发送邮件。我需要得到输出为“test123here”,但我只得到test123。有人能帮我找出我在哪里犯的错误吗C# 使用javascript和C发送邮件时出错#,c#,.net,email,C#,.net,Email,我正在使用下面的代码发送邮件。我需要得到输出为“test123here”,但我只得到test123。有人能帮我找出我在哪里犯的错误吗 MailMessage mail = new MailMessage(); string mailserver = "…."; if (mailserver != "") System.Web.Mail.SmtpMail.SmtpServer = mailserver; mail.From = "x@test.com"; mail.To = "y@test.co
MailMessage mail = new MailMessage();
string mailserver = "….";
if (mailserver != "")
System.Web.Mail.SmtpMail.SmtpServer = mailserver;
mail.From = "x@test.com";
mail.To = "y@test.com";
mail.Subject = "MailSubject";
mail.UrlContentBase = "http://localhost:1900";
mail.BodyFormat = MailFormat.Html;
string mailcontent = "<html><body> <div> test123<script> document.write('here');</script> </div> </body></html>";
mail.Body = mailcontent;
SmtpMail.Send(mail);
MailMessage mail=newmailmessage();
字符串mailserver=“…”;
如果(邮件服务器!=“”)
System.Web.Mail.SmtpMail.SmtpServer=mailserver;
mail.From=”x@test.com";
mail.To=”y@test.com";
mail.Subject=“MailSubject”;
mail.UrlContentBase=”http://localhost:1900";
mail.BodyFormat=MailFormat.Html;
string mailcontent=“test123 document.write('here');”;
Body=mailcontent;
SmtpMail.Send(邮件);
您不能在html电子邮件中执行javascript(通常)-与关闭原因无关。