Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

PowerBuilder Examples
Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
X
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(PowerBuilder) Example: Email.GetDsnInfo method

See more Email Object Examples
Demonstrates how to call the GetDsnInfo method.

Note: This example requires Chilkat v11.0.0 or greater.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Email
integer li_Success
oleobject loo_Json
string ls_StrVal
string ls_Reporting_mta
string ls_Action
string ls_Status
string ls_Remote_mta
string ls_X_supplementary_info
string ls_X_display_name
integer i
integer li_Count

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

li_Success = loo_Email.LoadEml("qa_data/eml/sample_multipart_report.eml")
if li_Success = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    return
end if

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

li_Success = loo_Email.GetDsnInfo(loo_Json)
if li_Success = 0 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Email
    destroy loo_Json
    return
end if

loo_Json.EmitCompact = 0
Write-Debug loo_Json.Emit()

// Sample output:

// {
//   "reporting-mta": "dns; Exchange2016.example.com",
//   "final-recipient": [
//     "herb.butterworth1247692846@gmail.com"
//   ],
//   "action": "failed",
//   "status": "5.1.1",
//   "remote-mta": "dns; mx.google.com",
//   "x-supplementary-info": "<mx.google.com #5.1.1 smtp;550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1  https://support.google.com/mail/?p=NoSuchUser o8-20020a056870968800b001b55816bea9si2188132oaq.70 - gsmtp>",
//   "x-display-name": "herb.butterworth1247692846@gmail.com"
// }

// Code for parsing the JSON:

ls_Reporting_mta = loo_Json.StringOf("reporting-mta")
ls_Action = loo_Json.StringOf("action")
ls_Status = loo_Json.StringOf("status")
ls_Remote_mta = loo_Json.StringOf("remote-mta")
ls_X_supplementary_info = loo_Json.StringOf("x-supplementary-info")
ls_X_display_name = loo_Json.StringOf("x-display-name")
i = 0
li_Count = loo_Json.SizeOfArray("final-recipient")
do while i < li_Count
    loo_Json.I = i
    ls_StrVal = loo_Json.StringOf("final-recipient[i]")
    i = i + 1
loop


destroy loo_Email
destroy loo_Json

 

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