Version 1.0
Small utility to send custom emails using SendGrid platform. The SendGrid platform free plan allows you to send up to 100 emails every day, so its really helpfull for simple applications. To use the platform:
- Create a new account with free plan
- Creates a sender
- Creates an API key
DO SendGrid
SG.Initialize(senderEmail, senderName, APIKey)
LOCAL oMsg
oMsg = SG.New()
WITH oMsg
.addRecipient("[email protected]","Foo1")
.addRecipient("[email protected]","Foo2")
.addCC("[email protected]", "Foo3")
.Subject = "SendGrid Test"
.Body = "This is a test email"
.appendBody(" from SendGrid library")
.addAttachment("c:\folder\file1.bmp")
.addAttachment("c:\folder\file2.bmp","application/octet","logo.bmp")
.addInlineAttchment("c:\folder\file3.txt","text/plain")
ENDWITH
LOCAL lResult
lResult = SG.Send(oMsg)
IF lResult
??"SENT!"
ELSE
FOR i = 1 TO SG.Errors.Count
?SG.Errors(i).MEssage, SG.Errors(i).Field, SG.Errors(i).Help
ENDFOR
ENDIF
Just use htmlBody property and appendHtmlBody() methods, instead of Body and appendBody().
DATE | USER | COMMENTS |
---|---|---|
FEB 24, 2024 | VES | Some outdated documentation fixed |
APR 16, 2022 | VES | Initial version |