Question regarding SMTP


Licensed User
Longtime User

I have a main process that needs to send an email and a service module that needs to send another email once some work is done

Quick question:
Should i be initializing SMTP only once in the Main activity ?

I am currently doing the following (declaring SMTP within a sub SendEmail)
This sub is in Main Activity as well as the Service module

Sub SendEmail
dim oSMTP as SMTP
oSMTP.Initialize("", 465, userid, pwd, "SMTP")
oSMTP.UseSSL = True
oSMTP.Subject = "Subject"
oSMTP.Body = "Some Body"
End Sub

Is this the right way to do it? or should i be initializing SMTP object only once in Globals in MAIN?

I have observed that the SendEmail module in MAIN works perfect all the time but sometimes the service module SendEmail is not working as expected. Wondering if reinitializing SMTP is the problem ....
Last edited: