我正在使用 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/