Groups | Blog | Home
all groups > vb.net controls > november 2004 >

vb.net controls : Wait 3 seconds before run next line



Jose Rojas
11/27/2004 5:41:00 PM
We are trying to send files to our list of clients at work, I been able to
produce the code that sends e-mail, but I only can do it for 2 before it
gave me an error, how can I do it that the system wait for 3 seconds before
I execute the next line?

Thanks in advance for your help.


Michael D. Ober
11/27/2004 6:34:28 PM
System.Threading.Thread.Sleep(3000).

The real issue here is that you need to check if the underlying CDOSYS
component is ready for the next message. I know in .Net Runtime 2.0 Beta 1
there is a property to check for this. There should also be a way to check
in the .Net Runtime 1.1. If there isn't, what you need to do is create a
new instance of the SMTPMail object for each message. This will allow each
email to complete asynchronously. You can safely discard any processing
instances as CDOSYS will complete its internal send method before releasing
any resources it allocated.

Mike Ober.

[quoted text, click to view]

Jose Rojas
11/27/2004 9:13:13 PM
Michael, thanks for the prompt attention to this post.

Its there any sample that you can help about checking to see if the CDOSYS
its ready for the next message, I try allow the system to wait for a couple
of seconds but that will only work if I know the total size of the file.

Thanks in advance for any help.

Jose
[quoted text, click to view]

Michael D. Ober
11/28/2004 2:53:58 PM
I couldn't find it in the .NET Runtime 1.1 SDK documentation. What I do on
our corporate web-site is create a completely new message and configuration
for each email. That seems to do the trick. CDOSYS is appears to be
multi-threaded internally so that each message and configuration object is
distinct from any other. I only figured out this problem from the .NET 2.0
SDK documentation.

Mike.

[quoted text, click to view]

Jose Rojas
11/28/2004 4:39:38 PM
Michael, thanks for the reply, that seems to be working right, well I am
testing the application and seems to be ok, I post the results on monday.
[quoted text, click to view]

AddThis Social Bookmark Button