Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

PowerBuilder Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Bitfinex v2 REST
Bluzone
BrickLink
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
Mastercard

MedTunnel
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter
UniPin
VoiceBase
Vonage
Walmart
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yousign
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(PowerBuilder) SendGrid Send Email with Additional BCC Recipient

See more SendGrid Examples

Sends an email to a recipient, but also with an additional BCC recipient.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_Resp

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// The following JSON is sent in the request body.

// {
//   "personalizations": [
//     {
//       "to": [
//         {
//           "email": "recipient@example.com"
//         }
//       ]
//       "bcc": [
//         {
//           "email": "recipient2@example2.com"
//         }
//       ]
//     }
//   ],
//   "from": {
//     "email": "sendeexampexample@example.com"
//   },
//   "subject": "Hello, World!",
//   "content": [
//     {
//       "type": "text/plain",
//       "value": "Heya!"
//     }
//   ]
// }

loo_Json = create oleobject
li_rc = loo_Json.ConnectToNewObject("Chilkat_9_5_0.JsonObject")

loo_Json.UpdateString("personalizations[0].to[0].email","recipient@example.com")
loo_Json.UpdateString("personalizations[0].bcc[0].email","recipient2@example2.com")
loo_Json.UpdateString("from.email","sendeexampexample@example.com")
loo_Json.UpdateString("subject","Hello, World!")
loo_Json.UpdateString("content[0].type","text/plain")
loo_Json.UpdateString("content[0].value","Heya!")

// Adds the "Authorization: Bearer YOUR_API_KEY" header.
loo_Http.AuthToken = "YOUR_API_KEY"
loo_Http.SetRequestHeader("Content-Type","application/json")

loo_Resp = loo_Http.PostJson3("https://api.sendgrid.com/v3/mail/send","application/json",loo_Json)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    return
end if

if loo_Http.LastMethodSuccess <> 1 then
    Write-Debug loo_Http.LastErrorText
else
    Write-Debug "response status code: " + string(loo_Resp.StatusCode)
    // Display the response.
    // If successful, the response code is 202 and the response body string is empty.
    // (The response body string may also be empty for error response codes.)
    Write-Debug loo_Resp.BodyStr
    destroy loo_Resp
end if



destroy loo_Http
destroy loo_Json

 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.