【发布时间】:2012-09-20 22:21:54
【问题描述】:
如何在电子邮件正文中发送 iframe。这就是我发送邮件的方式。
string getemail = textbox_email.Text;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(getemail);
message.Subject = "Hello";
message.From = new System.Net.Mail.MailAddress("sendingemail");
message.Body = "This is message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Credentials = new System.Net.NetworkCredential("sendingemail", "password");
smtp.EnableSsl = true;
smtp.Send(message);
Response.Write("Sent");
这是 html 中的 iframe。实际上 iframe 将包含 youtube 视频链接。
<iframe id="iframe" runat="server" src="http://www.w3schools.com" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
如何在电子邮件正文中发送? 提前致谢。
【问题讨论】:
-
mailmsg.IsBodyHtml=true;
-
谢谢,但是如何在正文中组合/附加 iframe?
-
我认为 gmail 或任何其他注明的 smtps 会阻止您的 iframe。我检查了您的代码并且 gamil 正在阻止它。您可能需要寻找不同的选项。这是关于 IFRAMES 替代品的 so 帖子stackoverflow.com/questions/6719053/…