通过c#一起发送许多电子邮件由Thunderbird

Cha*_*Poz 2 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);
}
Run Code Online (Sandbox Code Playgroud)

我想是因为我给每封电子邮件写了"-compose"所以它打开了一个新窗口,也许如果我写一个命令行就可以了.我试过了,但没有成功.

Dan*_*rth 6

你真的应该使用SmtpClient.NET框架中的类.