简体   繁体   English

从DataGrid发送邮件

[英]Send Mails From DataGrid

We have an existing winforms app that (connects to a .NET Remoting Service)has a grid containing list of clients mail need to be sent. 我们有一个现有的winforms应用程序(连接到.NET Remoting Service)具有一个网格,其中包含需要发送邮件的客户端列表。 It went well until a single user accessed the winform. 一切顺利,直到有一个用户访问了winform。 When multiple users start using the same form to fire mails to their respective clients at the same time..performance issues started creeping up! 当多个用户开始使用相同的表单同时向各自的客户端发送邮件时,性能问题开始蔓延!

For each mail sent, i need to update the row in the grid to green for success & red for failure. 对于发送的每个邮件,我需要将网格中的行更新为绿色表示成功,红色表示失败。

Time being we read one client at a time and make the remoting call since we have to update the row status. 由于我们必须更新行状态,因此我们一次只能读取一个客户端并进行远程调用。 Is it possible to send all the clients in one go and will I be able to update the grid individually! 是否可以一次性发送所有客户,我将能够单独更新网格!

Do you have any suggestions! 你有什么建议吗!

You're probably sending the emails in a synchronous call. 您可能正在同步呼叫中发送电子邮件。 Use the SendAsync method on the smtp client so you don't have to wait for every mail to be sent. 在smtp客户端上使用SendAsync方法,因此您不必等待每个邮件都被发送。

Have a look at http://msdn.microsoft.com/en-us/library/x5x13z6h.aspx 看看http://msdn.microsoft.com/en-us/library/x5x13z6h.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM