Subject Re: Sending Email
From Jan Hoelterling <jan@hoelterling.com>
Date Mon, 6 Oct 2025 08:29:23 -0600
Newsgroups dbase.getting-started

Milind,

I've been using Chilkat for a long time with very good results.

Here is some sample code that shows how easy it is to use:

        set proc to :classes:CK.CC

          mailman = new CK_Mailman()

          if type("_app.ms") <> "O"
             // email settings
             _app.MS = new object()
             _app.MS.SmtpUsername = "****"
             _app.MS.SmtpPassword = "****"
             _app.MS.SmtpHost     = "****"
             _app.MS.SmtpPort     = 587        
          endif

          *  Set the SMTP server.
          mailman.SmtpHost = _app.MS.SmtpHost
          mailman.SmtpPort = _app.MS.SmtpPort        
          if _app.MS.SmtpPort  = 587
             mailman.StartTLS = 1
          endif

          *  Set the SMTP login/password (if required)
          if empty(_app.MS.SmtpUsername)
             mailman.SmtpAuthMethod = "NONE"
          else
             mailman.SmtpUsername = _app.MS.SmtpUsername
             mailman.SmtpPassword = _app.MS.SmtpPassword
          endif

          * Create a new email object
          email = new CK_EMAIL()
          email.Subject = "Subject"
          email.From = "Error Reporting <****>"
          email.AddTo("Jan Hoelterling","***")

          if type("cAttachFile") = "C"
             Success = email.AddFileAttachment(sspath+cAttachFile)
             endif                 

          email.Body = "Message text to send"

          success = mailman.SendEmail(email)

I hope this helps,

Jan