有关在我的程序中使用mailto链接的问题 [英] Question about using a mailto link in my program

查看:64
本文介绍了有关在我的程序中使用mailto链接的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 Process.Start("mailto:myemailhere@gmail.com"&?subject = Log File"&& attachment ="& programDirectory&" \ logtemp.txt')

我似乎无法使附件部分正常工作.我在做什么错?

解决方案

我相信交换机实际上被命名为"attach",但是我不认为大多数现代电子邮件客户端都会这样做.由于安全原因,我们不再使用该交换机.您可能需要使用System.Net.Mail来发送带有附件的电子邮件.

(还要注意,从技术上讲mailto:字符串不应包含任何空格或标点;您应使用ascii代码的十六进制,例如%20表示空格)


Process.Start("mailto: myemailhere@gmail.com" & "?subject=Log File" & "&attachment=" & programDirectory & "\logtemp.txt")

I cannot seem to get the attachment part to work. What am I doing wrong?

解决方案

I believe the switch was actually named "attach", but I don't think that most modern email clients will honor the switch anymore due to security reasons.  You'll probably need to use System.Net.Mail to send the email with an attachment.

(also note that technically the mailto: string should not contain any spaces or punctuation; you should use the hex of the ascii code, like %20 for space)


这篇关于有关在我的程序中使用mailto链接的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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