使用javascript和C#发送邮件时出错

时间:2012-12-01 02:59:09

标签: 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.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);

0 个答案:

没有答案