如何在 C# MailMessage 中嵌入媒体播放器来播放附件
我正在使用 C# MailMessage 将波形文件 (8K) 附加到电子邮件。 我想在该电子邮件的正文中提供一个播放器,如果用户选择这样做,它将播放该波形文件。 我尝试过使用嵌入的
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我会尝试使用 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.
我认为这是不可能的,因为 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.
如果它不支持对象标签,请尝试使用嵌入标签:
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 :)
如果您知道邮件收件人正在运行 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.