Perl Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



Perl Examples

Quick Start
Perl Unicode
Perl Byte Array
Perl Certs
Perl Email
Perl Encryption
Perl FTP
HTML-to-XML
Perl HTTP
Perl IMAP
Perl MHT
Perl MIME
Perl RSA
Perl S/MIME
Perl Signatures
Perl Socket
Perl Spider
Perl Tar
Perl Upload
Perl XML
Perl XMP
Perl Zip

More Examples...
String
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

Create Multipart/Mixed MIME Message

Perl sample program showing how to create a multipart/mixed MIME message.

Download Perl Programming Example Scripts

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

use chilkat;

# Demonstrates how to create a multipart/mixed MIME message
# with 2 sub-parts: a text/plain body and a GIF file attachment.
$mime = new chilkat::CkMime();
$mime->UnlockComponent("anything for 30-day trial");
	    
# Initialize to a multipart/mixed content-type:
$mime->NewMultipartMixed();
		
# Create a text/plain MIME part.
$textBody = new chilkat::CkMime();
$textBody->SetBodyFromPlainText("This is the plain-text body!\nThank you.");
		
# Add it as a child to the multipart/mixed parent:
$mime->AppendPart($textBody);
		
# Load a GIF file as a new sub-part:
$mime->AppendPartFromFile("images/dudePerl.gif");
		
# Chilkat automatically generates a unique boundary string.
# Need to change it?  Do this:
$mime->put_Boundary("123--ABC--Blah-blah-blah");
		
# Print the MIME message:
print $mime->mime() . "\n\n";
				
# Prints this MIME:
# 
# content-type: multipart/mixed;
# 	boundary="123--ABC--Blah-blah-blah"
# 
# This is a multi-part message in MIME format.
# 
# --123--ABC--Blah-blah-blah
# 
# This is the plain-text body!
# Thank you.
# --123--ABC--Blah-blah-blah
# content-disposition: attachment;
# 	 filename="dudePerl.gif"
# content-transfer-encoding: base64
# content-type: image/gif;
# 	name="dudePerl.gif"
# 
# R0lGODlhZABkAPf/AP////ry8vrx8Pnx8fnw8PXn5vXl5PTk4/Pg4PPf3/DX1+7Pz+3R0e3L
# y+zQz+vg4OvV1evKyuvDw+rk5Ojo6Oi/v+fBweW6uuS/v+O/v+Kvr+G/v+Gyst6kpNyWltui
# otqurdm4uNmMi9eendePj9eIh9bKyta1tdW+vtWTk9WSkdOPj9KmpdJ5eNGAgNCEhMy8vMp1
# ...
# OPmTL5ERCSRh53on0rlzwUcT7AZO8ctyUFat+gR4UEKNQyplMJkekRCqDxEgERAAOw==
# 
# --123--ABC--Blah-blah-blah--
# 




 

Need a specific example? Send a request to support@chilkatsoft.com

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