c# - 通过 C# 通过 Thunderbird 一次发送多封电子邮件

标签 c# email command-line thunderbird

我正在使用 C# 通过 Thunderbird 向许多人发送电子邮件。我用循环来做。我的问题是,当我运行我的应用程序时 - 对于我发送的任何电子邮件,一个新的 Thunderbird 窗口正在打开,然后我需要按“发送”以便发送。很不方便。如何一次发送所有电子邮件?

我的代码:

string strCommand;
for(i=0;i<100;i++)
{
   strCommand = " -compose to=" + (char)34 + astrRecip[i] + (char)34 + ",";
   strCommand += "body=" + (char)34 + strMessage[i] + (char)34 + ",";
   strCommand += "subject=" + (char)34 + strSubject + (char)34 + ",";
   strCommand += "attachment=" + (char)34 + strAttachment[i] + (char)34;
   Process.Start(@"C:\Program Files\Mozilla Thunderbird\thunderbird", strCommand);
}

我认为因为我在每封电子邮件中都写了“-compose”,所以它会打开一个新窗口,也许如果我写一个命令行就可以了。我试过了,但没有成功。

最佳答案

你真的应该使用 SmtpClient来自 .NET 框架的类。

关于c# - 通过 C# 通过 Thunderbird 一次发送多封电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12405588/

相关文章:

c# - 来自基类的用户定义转换运算符

javascript - 我如何根据所选的单选按钮传递值?

将谷歌地图集成到 Unity3D 错误的 C# 脚本

email - 如何以良好的成功率发送批量电子邮件?

bash ->(大于)在命令行开头的具体作用是什么

vba - WScript.Shell 运行一个脚本,路径中有空格,参数来自 VBA

c# - 如何使用 .net 减小从 ssrs 生成的 pdf 文件的大小

java - 通过 Microsoft Exchange 发送电子邮件

java - 正则表达式电子邮件地址验证

java - 在 1 个命令行中添加 2 个类路径