Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Add a file/image encoded as a Base64 string to an emailDownload: Chilkat .NET Assemblies Demonstrates how to add a file/image encoded as a Base64 string to an email. Chilkat.MailMan mailman = new Chilkat.MailMan(); mailman.UnlockComponent("Anything for 30-day trial"); // First, load the image from a file and convert it to base64. // The Crypt2.Encode/Decode methods are always unlocked and // do not require a license. The Crypt2.ReadFile/WriteFile // methods are also free. Chilkat.Crypt2 crypt = new Chilkat.Crypt2(); byte[] gifImage = crypt.ReadFile("dude.gif"); string gifBase64 = crypt.Encode(gifImage, "base64"); // This is our starting point. We have an image encoded as a // base64 string and we want to add it as an attachment to the email. Chilkat.Email email = new Chilkat.Email(); email.Subject = "Test"; email.From = "support@chilkatsoft.com"; email.AddTo("Matt", "matt@chilkatsoft.com"); email.Body = "Email with image attachment added from base64 string."; // Use the Crypt2.Decode method to decode... email.AddDataAttachment("dude.gif", crypt.Decode(gifBase64,"base64")); email.SaveEml("test.eml"); Important: The download for this
example does not contain the ChilkatDotNet.dll which |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.