Integer hoMailMan
Get Create (RefClass(cComChilkatMailMan2)) to hoMailMan
Integer iRetVal
Get ComUnlockComponent of hoMailMan "..." to iRetVal
If (not(iRetVal)) Begin
// error
Procedure_Return
End
Set ComSmtpHost of hoMailMan to "hostname"
Set ComSmtpPort of hoMailMan to 587
Set ComSmtpSsl of hoMailMan to True
Set ComStartTLS of hoMailMan to True // depends on server
Set ComSmtpUsername of hoMailMan to "user"
Set ComSmtpPassword of hoMailMan to "password"
Integer hoEmail
Get Create (RefClass(cComChilkatEmail2)) to hoEmail
Send CreateComObject to hoEmail
Set ComSubject of hoEmail to "Subject"
Set ComBody of hoEmail to "Body"
Set ComFrom of hoEmail to "from"
Get ComAddTo of hoEmail "recipient" "recipemail" to iRetVal
Get ComSendEmail of hoMailMan (pvComObject(hoEmail)) to iRetVal
If (not(iRetVal)) Begin
// error
String sErrorText
Get ComLastErrorText of hoMailMan to sErrorText
Send Info_Box sErrorText
End
Send ComCloseSmtpConnection to hoMailMan
Send Destroy to hoEmail
Send Destroy to hoMailMan