Html IFrame标记在电子邮件正文中不被解释 [英] Html IFrame tag is not being interpret in email body

查看:205
本文介绍了Html IFrame标记在电子邮件正文中不被解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在电子邮件正文中发送一个html文件(其中包含一个iframe)。html文件在浏览器中正常工作并播放视频。但是当我将其发送到电子邮件正文中时,iframe标签未被解释所以不会显示在身上。
这是html文件。

I need to send a html file(which contains a iframe) inside a email body.The html file is working fine in a browser and playing a video.But when i send it inside email body,iframe tag is not getting interpreted so does not show in the body. This is html file.

<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#代码。

Email body only displaying a "Aman" in bold.This is C# code.

        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不被解释?我错过了什么吗?

Why iframe is not being interpret?Am i missing anything?

请帮助并提供解决方案。

Please help and provide solutions.

提前感谢

推荐答案

电子邮件不支持其中的对象标签。
阅读此

emails doesn't support objects tags inside them. read this

我甚至试图从YouTube发送一个YouTube视频,甚至没有将视频嵌入电子邮件正文。

I even tried to send myself a youtube video from youtube, and even them not embedding the video in side the email body.

而不是尝试将视频嵌入链接(如youtube)

Instead of trying to embed the video as a link (like youtube does)

这篇关于Html IFrame标记在电子邮件正文中不被解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆