如何在 C# MailMessage 中嵌入媒体播放器来播放附件

发布于 2024-07-04 03:16:02 字数 201 浏览 6 评论 0原文

我正在使用 C# MailMessage 将波形文件 (8K) 附加到电子邮件。 我想在该电子邮件的正文中提供一个播放器,如果用户选择这样做,它将播放该波形文件。 我尝试过使用嵌入的 WMP 版本和 cid: 对文件的引用,但 Outlook 2003 拒绝对象标记并且不会运行它。 如果有帮助,我知道我的用户将使用 Outlook 2003。

I'm using a C# MailMessage to attach a wave file (8K) to an email message. I'd like to provide a player within the body of that email message that will play that wave file if the user chooses to do so. I've tried using the embedded <object> version of WMP, and a cid: reference to the file, but Outlook 2003 rejects the object tag and won't run it. If it helps, I know my users will be on Outlook 2003.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

微暖i 2024-07-11 03:16:02

我会尝试使用 EMBED 标签。 我对 OBJECT 不起作用并不感到太惊讶,因为调用 ActiveX 控件是电子邮件系统中潜在的“安全漏洞”。 我也不确定 EMBED 是否有效,这可能是设计使然。 许多用户会发现这种行为是不可取的(他们的电子邮件在 Outlook 中打开时能够执行多媒体操作),而预期的用户体验是列出附件并提供单击时执行附件的选项。
如果您不希望他们必须在关联的多媒体应用程序上本地播放该多媒体内容,另一种方法可能是让他们单击一个链接来打开嵌入了多媒体的网页。

I would try using the EMBED tag. I'm not too surprised that OBJECT doesn't work, as invoking an ActiveX control is a potential "security hole" of sorts in the email system. I'm not sure that EMBED would work either though, and that's probably by design. Many users would find that behavior undesirable (their email being able to take multimedia actions on opening in Outlook) and the expected user experience is to have attachments listed with the option to execute them on click.
The alternative might be to have a link they could click that would open a web page with the multimedia embedded, if you don't want them to have to play it locally on their associated multimedia app.

成熟的代价 2024-07-11 03:16:02

我认为这是不可能的,因为 Outlook 中禁用了 ActiveX 和 Javascript。

似乎最好只链接到具有带有音频文件的嵌入式播放器的网页。

I don't think this is possible as ActiveX and Javascript are disabled in Outlook.

It seems like it would be better to just link to a web page that has an embedded player with the audio file.

听风吹 2024-07-11 03:16:02

如果它不支持对象标签,请尝试使用嵌入标签:

http://www.mioplanet.com/rsc/embed_mediaplayer.htm" rel="nofollow noreferrer">http://www.mioplanet.com mioplanet.com/rsc/embed_mediaplayer.htm

我不知道它是否有效,但值得一试:)

If it don't support objects tags, then try the Embed tag instead:

http://www.mioplanet.com/rsc/embed_mediaplayer.htm

I don't know it if works, but it is worth a shot :)

夜清冷一曲。 2024-07-11 03:16:02

如果您知道邮件收件人正在运行 Outlook(这意味着您正在内部使用它),则可以通过将播放器控件合并到 自定义 Outlook 表单

If you know the message recipients are running Outlook (which implies you're using this internally), you might be able to accomplish something even better by incorporating your player controls into a custom Outlook form.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文