All pastes #20330 Raw Edit

Someone

public text v1 · immutable
#20330 ·published 2005-08-18 17:07 UTC
rendered paste body
	my $msg = MIME::Lite->new(To      => $dest,
							  From    => $src,
							  Subject => "NAACP Letter to members",
							  Type    => 'multipart/mixed');

    my $letter = $msg->attach(Type => 'multipart/alternative');



    ### Alternative #1 is the plain text:
	my $plain = $letter->attach(Type => 'text/plain',
							 Path => 'letter.txt');

    ### Alternative #2 is the HTML-with-content:
	my $fancy = $letter->attach(Type => 'multipart/related');
	$fancy->attach(Type => 'text/html',
				   Path => 'letter.html');
	$fancy->attach(Type => 'image/gif',
				   Path => 'watermark.gif',
				   Id   => 'watermark');
	$fancy->attach(Type => 'image/png',
				   Path => 'letterhead.png',
				   Id   => 'letterhead');
	$fancy->attach(Type => 'image/png',
				   Path => 'signatures.png',
				   Id   => 'signatures');

	my $form = $msg->attach(Type => 'application/pdf',
						   Path => 'NAACP-SponsorshipLTR.pdf',
						   Disposition => 'attachment');