NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: robirenz on October 19, 2009, 07:06:26 AM

Title: sending email with webserver but on it's own thread
Post by: robirenz on October 19, 2009, 07:06:26 AM
I have a webserver app where I send Email back to the use of the data that they have been capturing.
my problem is that I have a very flaky smtp server so I would like to be able to put the email function into it's own thread so that my app will not wait there for a minute before the function replies it can't do that at the moment and the user does not despair and start mucking with the web browser, refreshing, moving back and so on.

I have set up my function like in the example.

SendEmailDEG('smtp.mydomain.com',25,'email@mydomain.com',file:emailtosendto,'CAPTURED INFORMATION','','','',loc:completetexttosend)

So I try to add a start at the beginning...

start( SendEmailDEG('smtp.mydomain.com',25,'email@mydomain.com',file:emailtosendto,'CAPTURED INFORMATION','','','',loc:completetexttosend),25000)

that won't compile

so I add like in documentation

start(SendEmailDEG ,25000,'smtp.mydomain.com',25,'email@mydomain.com',file:emailtosendto,'CAPTURED INFORMATION','','','',loc:completetexttosend)

but that won't compile either..

Any idea of how to do this or what I'm doing wrong?

Best Regards...

Roberto Renz

Title: Re: sending email with webserver but on it's own thread
Post by: Graham on October 19, 2009, 07:36:58 AM
Hi Roberto,

The START function can accept up to 3 string parameters so the compiler won't like your SendMail prototype as there are quite a few more than 3 parameters.

You could create a group structure for all your parameters, then declare a string OVER this group and pass this string in the START call to your SendMail procedure.

Hope that helps

Regards
Graham
Title: Re: sending email with webserver but on it's own thread
Post by: ccordes on October 21, 2009, 06:42:43 PM
Graham.
PMFJI
Thanks for the general tip on passing parameters to a new thread. This was killing me and I never thought of using an overed string as a data structure.  ::)

Chris c