Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

C# UWP/WinRT Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
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
MS Storage Providers
Microsoft Graph
NTLM
OAuth1
OAuth2
Office365
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(C# UWP/WinRT) Save Email Attachments to Filesystem

Saves email attachments to a directory.

Chilkat Universal Windows Platform (UWP) / WinRT Downloads

Chilkat for the Universal Windows Platform (UWP)

Chilkat.Email email = new Chilkat.Email();

//  Load an email object containing attachments.
//  This .eml can be downloaded from:
//  http://www.example-code.com/testData/HtmlEmail.eml
bool success;
success = email.LoadEml("HtmlEmail.eml");
if (success != true) {
    Debug.WriteLine(email.LastErrorText);
    return;
}

//  If OverwriteExisting is turned on, files with the same
//  name are overwritten.  If turned off, new/unique filenames
//  are automatically generated.  The filenames actually saved
//  are accessible via the GetAttachmentFilename method.
email.OverwriteExisting = true;

//  Save all attachments to the "myAttachments" subdirectory
//  found under the calling process's current working directory.
//  This directory is automatically created if it does not already
//  exist.
success = email.SaveAllAttachments("myAttachments");
if (success != true) {
    Debug.WriteLine(email.LastErrorText);
    return;
}

//  List the attachment filenames:
int i;
for (i = 0; i <= email.NumAttachments - 1; i++) {
    Debug.WriteLine(email.GetAttachmentFilename(i));
}


 

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