Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Getting TO / CC Email Recipients
Demonstrates how to examine the TO and CC recipients of an email.
Note: BCC recipients are generally NOT found in the email's MIME. "BCC" is a "Blind Carbon Copy", which means that the TO and CC recipients of the email should not be able to see the BCC recipients. If the BCC email addresses were found in the MIME header, then they would no longer be "blind" because nothing would prevent the other recipients from seeing the list of BCC recipients.
To understand how BCC recipients receive an email, I recommend reading this blog post: SMTP Protocol in a Nutshell. The BCC recipients are passed to the SMTP server in “RCPT TO” commands.
integer li_rc oleobject loo_Email integer li_Success integer i integer li_NumTo integer li_NumCC // An email can have any number of To, CC, or Bcc recipients. loo_Email = create oleobject li_rc = loo_Email.ConnectToNewObject("Chilkat_9_5_0.Email") if li_rc < 0 then destroy loo_Email MessageBox("Error","Connecting to COM object failed") return end if li_Success = loo_Email.LoadEml("sample.eml") if li_Success <> 1 then Write-Debug loo_Email.LastErrorText destroy loo_Email return end if // It doesn't matter if the email object was loaded from a .eml file, // or if it was downloaded from a POP3 or IMAP server. // The methods and properties for examining the TO and CC // recipients are the same. // The number of TO recipients is found in the NumTo property li_NumTo = loo_Email.NumTo // Iterate over each TO recipient if li_NumTo > 0 then for i = 0 to li_NumTo - 1 Write-Debug "TO Friendly Name and Address: " + loo_Email.GetTo(i) Write-Debug "TO Address: " + loo_Email.GetToAddr(i) Write-Debug "TO Friendly Name: " + loo_Email.GetToName(i) Write-Debug "---" next end if // The number of CC recipients is found in the NumCC property li_NumCC = loo_Email.NumCC // Iterate over each CC recipient if li_NumCC > 0 then for i = 0 to li_NumCC - 1 Write-Debug "CC Friendly Name and Address: " + loo_Email.GetCC(i) Write-Debug "CC Address: " + loo_Email.GetCcAddr(i) Write-Debug "CC Friendly Name: " + loo_Email.GetCcName(i) Write-Debug "---" next end if destroy loo_Email
© 2000-2023 Chilkat Software, Inc. All Rights Reserved.