3

我正在使用以下代码发送邮件。我需要将输出作为“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.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);
4

0 回答 0