SMTP: Difference between revisions

101 bytes added ,  23 February 2019
m
add syntax highlighting
m (add syntax highlighting)
Line 41: Line 41:
# Add the following object to the top of the view, anywhere inside or outside of the view itself:
# Add the following object to the top of the view, anywhere inside or outside of the view itself:


<source lang="dataflex">
     Object oComMailSender is a cComMailSender
     Object oComMailSender is a cComMailSender
     End_Object
     End_Object
 
</source>
And then we need to create the object.
And then we need to create the object.


<source lang="dataflex">
     Send CreateComObject to oComMailSender
     Send CreateComObject to oComMailSender
</source>


The COM object must be created prior to it’s being used.  One of the common problems is once the code is complete you get an error about the object being activated before it’s instantiated.  Add the create statement just below the object declaration.
The COM object must be created prior to it’s being used.  One of the common problems is once the code is complete you get an error about the object being activated before it’s instantiated.  Add the create statement just below the object declaration.
Line 52: Line 55:
In aspemail.pkg at the bottom in class cComMailSender you will find a line as follows:
In aspemail.pkg at the bottom in class cComMailSender you will find a line as follows:


<source lang="dataflex">
   Set peAutoCreate to acNoAutoCreate
   Set peAutoCreate to acNoAutoCreate
</source>


When an [[ActiveX]] component is created, this is set to AutoCreate, but when a COM Automation component is created, it’s set to NoAutoCreate.  This could be changed in aspemail.pkg or simply add the line as shown above.  
When an [[ActiveX]] component is created, this is set to AutoCreate, but when a COM Automation component is created, it’s set to NoAutoCreate.  This could be changed in aspemail.pkg or simply add the line as shown above.


===Sending the email===
===Sending the email===