Sample code for 30+ languages & platforms
Perl

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $email = Chilkat2::Email->new;
my $success = $email->LoadEml('qa_data/eml/sample.eml');

# Write the full MIME of the email to a StringBuilder.
my $sbMime = Chilkat2::StringBuilder->new;
$email->GetMimeSb($sbMime);

# Load the MIME object from the StringBuilder
my $mime = Chilkat2::Mime->new;
$success = $mime->LoadMimeSb($sbMime);

print $mime->GetMime(), "\n";