Subject |
Re: Sending Email |
From |
Carlos Pereira [APKomp] <carlos.pereira@apkomp.com> |
Date |
Mon, 6 Oct 2025 15:42:26 +0100 |
Newsgroups |
dbase.getting-started |
A good answer.
Thank you.
Às 15:29 de 2025-10-06, Jan Hoelterling escreveu:
> 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
|
|