【问题标题】:javascript mailto attachment not showing upjavascript mailto附件未显示
【发布时间】:2010-09-24 14:09:15
【问题描述】:

我正在尝试创建一个小型网络应用程序,其中在一种形式中,用户可以输入某些参数作为消息的一部分,然后在他点击一个按钮后,它将显示一个 Outlook(取决于他的默认电子邮件客户端) 电子邮件客户端弹出窗口,其中包含他放置的所有详细信息.. 然后它将包含一个附件。

javascript 代码如下所示:

function submitReport()
{
  var remarks = document.getElementById('remarks').value;

  if(remarks != '')
    body += 'Remarks: '+remarks;

  var href = 'mailto:bug_support@emailadd.com?subject=[Bug Report]  '+menu_path+'&body='+body;

  href += '&attachment="C:\\debug.log"';

  var form = DomUtils.createForm();
  form.setAttribute('action', href);
  form.submit();
}

我尝试提醒“href”变量,它显示:

mailto:bug_support@emailadd.com?subject=[Bug Report]&body=message_bodyReport 类型:每月开始日期:2010-05-01 00:00:00结束日期:2010-05-31 23:59:59&attachment="C :\debug.log"

而且肯定会弹出一个包含所有主题、收件人电子邮件地址、正文的外部客户端。 但没有附件。有人遇到过这个吗? :(

这里使用的前景是 2007.. 如果我在 IE 中运行 web 应用程序,它实际上会显示错误

“命令行参数无效。请验证您正在使用的开关。”

有什么想法吗?

【问题讨论】:

    标签: javascript outlook attachment mailto


    【解决方案1】:

    网页无法让浏览器打开用户的电子邮件客户端,其中包含从硬盘预先附加的文件。

    使用form 并在服务器端对其进行处理,或提供以下简单说明:

    <p>Send an email to <a href="mailto:foo@example.com">foo@example.com</a>
    and attach your log file.</p>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-14
      • 1970-01-01
      • 1970-01-01
      • 2010-12-08
      • 1970-01-01
      • 2011-10-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多