NetTalk Central

Author Topic: sending email with webserver but on it's own thread  (Read 3376 times)

robirenz

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
sending email with webserver but on it's own thread
« 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


Graham

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: sending email with webserver but on it's own thread
« Reply #1 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

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: sending email with webserver but on it's own thread
« Reply #2 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
Real programmers use copy con newapp.exe