我将使用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
实现似乎比通过第三方程序更容易。由于他们不理解为什么应该使用该程序的要求,因此将提出其他看似更简单的解决方案。我对你说“没有地方在这里写它们”的回应只是因为没有使用它的好理由。因此,将提出其他解决方案。当你说“你的老板想要它”时,这是一个可以改变以达到更简单解决方案的要求。 - default