Perl Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Building MIME w/ any Charset / Character Encoding

 Chilkat Perl Module Downloads for Windows, Linux, and MAC OS X

Perl example script showing how to build a MIME message using any character encoding / charset.

# file: mimeCharsets.pl
# Perl MIME parsing script / create MIME in Perl.

use chilkat;

# Chilkat MIME makes it easy to create MIME using different charsets.
$mime = new chilkat::CkMime();
$mime->UnlockComponent("anything for 30-day trial");

$mime->put_Charset("iso-8859-1");
$mime->put_Encoding("quoted-printable");

# Add some Danish text to make it interesting:
$mime->SetBodyFromPlainText("Jeg kan spise glas, det gør ikke ondt på mig.");

# Add a header with some Danish chars...
$mime->SetHeaderField("subject","gør ikke ondt på mig");
$mime->SetHeaderField("junk1","gør på");
$mime->SetHeaderField("junk2","abc 123");

print $mime->mime() . "\n\n";

# We get the following $mime->  Notice that the headers are
# Q-encoded where necessary:
#		    
# content-transfer-encoding: quoted-printable
# content-type: text/plain;
#	 charset="iso-8859-1"
# subject: =?iso-8859-1?Q?g=F8r_ikke_ondt_p=E5_mig?=
# junk1: =?iso-8859-1?Q?g=F8r_p=E5?=
# junk2: abc 123
#
# Jeg kan spise glas, det g=F8r ikke ondt p=E5 mig.



# Change the charset to utf-8.  With utf-8, each 8bit Danish character
# will be encoded in two bytes rather than one.
$mime->put_Charset("utf-8");
print $mime->mime();

# Prints this:
# 		
# content-transfer-encoding: quoted-printable
# subject: =?utf-8?Q?g=C3=B8r_ikke_ondt_p=C3=A5_mig?=
# junk1: =?utf-8?Q?g=C3=B8r_p=C3=A5?=
# junk2: abc 123
# content-type: text/plain;
# 	 charset="utf-8"
# 
# Jeg kan spise glas, det g=C3=B8r ikke ondt p=C3=A5 mig.
		



# -----------------------------------------		
# Chilkat supports all major international charsets, including
# Asian languages.





 

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