NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rjolda on February 12, 2024, 07:47:37 AM

Title: Starting NetWeb E Mail on own thread - compile problem
Post by: rjolda on February 12, 2024, 07:47:37 AM
Hi,
Basic question which I am having problems solving.  NT14.16, C11.0.136.
SendEMail procedure has:
  Prototype:  (EmailParametersGroup pEmail),long,proc
  Parameters:  (EmailParametersGroup pEmail)


THis works correctly ( on same thread):
  If SendEmail(parms) = 0
    .....
   end

However, i want to send E mail on its own thread:
START(SendEmail,35000,parms) gives "No Matching Prototype error"

What am I missing?
Thanks,
Ron
Title: Re: Starting NetWeb E Mail on own thread - compile problem
Post by: Stu on February 12, 2024, 12:38:45 PM
Hey Ron,

Are the "params" you mention strings?

Pretty sure START() can only send through parameters as STRIING type.

Code: [Select]
START(SendEmail,35000,pSubject,pToList,pEmailBody)
That kind of thing. At least, that's in my experience.
Title: Re: Starting NetWeb E Mail on own thread - compile problem
Post by: rjolda on February 12, 2024, 02:40:28 PM
Hi
From Net Talk Documentation:
 Calling the SendEmail Procedure
The SendEmail procedure can be acalled from any other procedure. It might be a button, or a menu item, or it might happen in source code when some event occurs. To call SendEmail follow these steps:
Create a local variable in the procedure;
parms group(EmailParametersGroup).
Where you want to send the email, prime the components of the parms parameter
clear(parms)
parms.pEmailTo = 'bruce@capesoft.com'
parms.pEmailFrom = glo:UserEmail
parms.pEmailSubject = 'Great Release'
parms.pEmailCC = ''
parms.pEmailBCC = ''
parms.pEmailFileList = ''
parms.pEmailEmbedList = ''
parms.pEmailMessageTextST.SetValue('Well done on a great release')
parms.pEmailMessageHTMLST.SetValue('<html>...</html>')
Call the SendEmail procedure. You can do this on another thread;
START(SendEmail,25000,parms)   <<<<<<<<=========================
or on the same thread (in which case you get a returned value;
result = SendEmail(parms)


Ron
Title: Re: Starting NetWeb E Mail on own thread - compile problem
Post by: seanh on February 16, 2024, 05:41:34 PM
Does sendEmail()  have a ,PROC  in the prototype ? 
I think that might be needed