gpt4 book ai didi

c# - 电子邮件正文中未解释 Html IFrame 标记

转载 作者:行者123 更新时间:2023-11-30 15:02:26 25 4
gpt4 key购买 nike

我需要在电子邮件正文中发送一个 html 文件(其中包含一个 iframe)。该 html 文件在浏览器中运行良好并播放视频。但是当我在电子邮件正文中发送它时,iframe 标签没有得到解释所以不会显示在 body 上。这是 html 文件。

<b>Aman</b>
<iframe height="390" frameborder="0" width="640"
src="http://www.youtube.com/embed/Sf5T5KjMpJU?wmode=transparent"
title="YouTube video player"></iframe>

电子邮件正文仅以粗体显示“Aman”。这是 C# 代码。

        StreamReader reader = File.OpenText("C:\\Users\\Girish\\Desktop\\amrit\\Jeff_Project\\indeex.html");
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";
message.IsBodyHtml = true;
message.Body = reader.ReadToEnd();
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");

为什么 iframe 没有被解释?我错过了什么吗?

请帮助并提供解决方案。

提前致谢。

最佳答案

电子邮件不支持其中的对象标签。 read this

我什至尝试从 youtube 向自己发送一个 youtube 视频,甚至他们也没有将视频嵌入到电子邮件正文中。

而不是尝试将视频作为链接嵌入(就像 youtube 那样)

enter image description here

关于c# - 电子邮件正文中未解释 Html IFrame 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12652770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com