Search code examples
c#.netremoting

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. It went well until a single user accessed the 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!


Solution

  • 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.

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