javascript mailto 附件不显示
我正在尝试创建一个小型网络应用程序,其中在一种形式中,用户可以输入某些参数作为消息的一部分,然后在他点击按钮后,它将显示 Outlook(取决于他的默认电子邮件客户端)电子邮件客户端弹出窗口显示他放置的所有详细信息..然后它将包含一个附件。
javascript代码如下所示:
function submitReport()
{
var remarks = document.getElementById('remarks').value;
if(remarks != '')
body += 'Remarks: '+remarks;
var href = 'mailto:[email protected]?subject=[Bug Report] '+menu_path+'&body='+body;
href += '&attachment="C:\\debug.log"';
var form = DomUtils.createForm();
form.setAttribute('action', href);
form.submit();
}
我尝试警告“href”变量,它显示:
mailto: [email protected]?subject=[Bug Report]&body=message_body报告类型:每月开始日期:2010-05-01 00:00:00结束日期:2010-05-31 23:59:59&附件="C:\debug.log"
并且肯定会弹出一个外部客户端,其中包含所有主题、收件人电子邮件地址、正文。 但没有附件。以前有人遇到过这个吗? :(
这里使用的展望是 2007 年.. 如果我在 IE 中运行 Web 应用程序,它实际上会显示错误
“命令行参数无效。请验证您正在使用的开关。”
有什么想法吗?
i'm trying to create a small web app wherein in one form, the user may type in certain parameters as part of the message, then after he hits a button, it will show an Outlook (depends on his default email client) email client popup with all the details he placed.. and then it will include an attachment.
the javascript code looks like this:
function submitReport()
{
var remarks = document.getElementById('remarks').value;
if(remarks != '')
body += 'Remarks: '+remarks;
var href = 'mailto:[email protected]?subject=[Bug Report] '+menu_path+'&body='+body;
href += '&attachment="C:\\debug.log"';
var form = DomUtils.createForm();
form.setAttribute('action', href);
form.submit();
}
i tried alerting the "href" variable and it shows:
mailto:[email protected]?subject=[Bug Report]&body=message_bodyReport Type: MonthlyStart Date: 2010-05-01 00:00:00End Date: 2010-05-31 23:59:59&attachment="C:\debug.log"
and surely an outclient popsup with all the subject, recepient email address, body..
but no attachment. anybody encountered this before? :(
the outlook used here is 2007..
if i run the web app in IE, it actually says an error
"The command line argument is not valid. Verify the switch you are using."
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
网页无法使浏览器使用硬盘上预先附加的文件打开用户的电子邮件客户端。
使用表单并在服务器端处理它,或者沿着行:
There is no way for a web page to cause a browser to open the user's email client with a file pre-attached from the hard disk.
Use a form and process it server side, or provide simple instructions along the lines of: