R
ronchese
Hello.
I'm using System.Net.Mail.SmtpClient class to send e-mails.
Actually, I'm breaking the recipients in lots of 10 emails for each e-mail I send, and sending it to a machine that has the SMTP program that delivers the messages.
For understanding how it is working, there is a little sample that I wrote for brevity:
'colEmails is a ArrayList collection of System.Net.Mail.MailMessage objects.
'this collection was done to set a maximum of 10 recipients for each email object.
'send all email objects
For i as Integer = 0 to colEmails.Count - 1
Dim objSmtp As New System.Net.Mail.SmtpClient
objSmtp.Send(colEmails.Item(i))
Next
'Note ==> I need to send each email object using a new SMTP session
But, we noticed in the SMTP program, all the e-mails were sent by one session only. I thought the code above would do that, once I'm starting a new SmtpClient object for each email object. But didn't.
My doubt is, we need to configure the SMTP program ou it could be done by code, so it start a new session automatically instead of staking in a existent one? And how we can do it?
Cesar
I'm using System.Net.Mail.SmtpClient class to send e-mails.
Actually, I'm breaking the recipients in lots of 10 emails for each e-mail I send, and sending it to a machine that has the SMTP program that delivers the messages.
For understanding how it is working, there is a little sample that I wrote for brevity:
'colEmails is a ArrayList collection of System.Net.Mail.MailMessage objects.
'this collection was done to set a maximum of 10 recipients for each email object.
'send all email objects
For i as Integer = 0 to colEmails.Count - 1
Dim objSmtp As New System.Net.Mail.SmtpClient
objSmtp.Send(colEmails.Item(i))
Next
'Note ==> I need to send each email object using a new SMTP session
But, we noticed in the SMTP program, all the e-mails were sent by one session only. I thought the code above would do that, once I'm starting a new SmtpClient object for each email object. But didn't.
My doubt is, we need to configure the SMTP program ou it could be done by code, so it start a new session automatically instead of staking in a existent one? And how we can do it?
Cesar