我想使用默认电子邮件应用程序发送没有附件的简单电子邮件。
我知道可以使用 Process.Start 来完成,但我无法让它工作。这是我目前所拥有的:
string mailto = string.Format("mailto:{0}?Subject={1}&Body={2}", "to@user.com", "Subject of message", "This is a body of a message");
System.Diagnostics.Process.Start(mailto);
但它只是打开带有预先编写文本的 Outlook 邮件。我想直接发送,而无需用户手动单击“发送”按钮。我错过了什么?
谢谢
最佳答案
你需要这样做:
string mailto = string.Format("mailto:{0}?Subject={1}&Body={2}", "to@user.com", "Subject of message", "This is a body of a message");
mailto = Uri.EscapeUriString(mailto);
System.Diagnostics.Process.Start(mailto);
关于c# 使用 Process.Start 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26403861/