Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Access Attached Message (Embedded Email)How to access an email embedded within another email (i.e. an attached message).
#include <CkEmail.h> void ChilkatSample(void) { CkString strOut; CkEmail email; // Load an email from a .eml bool success = email.LoadEml("embeddedEmail.eml"); if (success != true) { strOut.append(email.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } // Display how many attached emails are embedded within // this one: int numAttached = email.get_NumAttachedMessages(); strOut.append("numAttached = "); strOut.appendInt(numAttached); strOut.append("\r\n"); // Get the 1st attached message. CkEmail *email2 = 0; email2 = email.GetAttachedMessage(0); if (email.get_LastMethodSuccess() == true) { // Display the subject, From, and a header field... strOut.append(email2->subject()); strOut.append("\r\n"); strOut.append(email2->ck_from()); strOut.append("\r\n"); strOut.append(email2->getHeaderField("X-SOMETHING")); strOut.append("\r\n"); } SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.