By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

Mail::Sender problem

P: n/a
Hi there,

I'm trying to create an html mail with embedded pictures in it. I run perl
on Windows and Red Hat but I cannot get your module (Mail::Sender) to work.
I'm just trying to run the examples. Below this message you'll find the perl
example I'm using and the header of the e-mail. What am I doing wrong?

Merijn Boom

Perl code:

use strict;

use Mail::Sender;

my $recipients = 'm*****';

eval {

(new Mail::Sender)


to => 'mailto',

FROM => 'mailfrom',

subject => 'Alternatives with images',

# debug => 'c:\temp\zkMailFlow.log',

multipart => 'related',

smtp => '',


->Part({ctype => 'multipart/alternative'})

->Part({ ctype => 'text/plain', disposition
=> 'NONE', msg => 'A long mail message.'})

->Part({ctype => 'text/html', disposition =>
'NONE', msg => '<html><body><h1>A long</h1><p align=center>mail message.<img



description => 'ed\'s GIF',

ctype => 'image/GIF',

encoding => 'base64',

disposition => "inline;
filename=\"apache_pb.gif\";\r\nContent-ID: <img1>",

file => 'apache_pb.gif'



} or print "Error sending mail: $Mail::Sender::Error\n";

My Header:

To: *

From: *

Subject: Alternatives with images

Date: Sat, 21 Feb 2004 09:57:55 +0100

X-Mailer: Perl script ""

using Mail::Sender 0.8.10 by Jenda Krynicky, Czechlands

running on medusa (

under account "m.boom"

Message-ID: <20040221_085755_005175.*>

MIME-Version: 1.0

Content-type: multipart/related;


Return-Path: *
X-OriginalArrivalTime: 21 Feb 2004 08:58:38.0243 (UTC)


Content-Type: multipart/alternative;


Content-type: text/plain

Content-transfer-encoding: 7BIT


Content-type: image/GIF; name="apache_pb.gif"

Content-description: ed's GIF

Content-transfer-encoding: base64

Content-disposition: inline; filename="apache_pb.gif";

Content-ID: <img1>



My Message:

A long mail message.--Part-Message-Boundary-by-Mail-Sender-1077353872_2

Content-type: text/html

Content-transfer-encoding: 7BIT

<html><body><h1>A long</h1><p align=center>mail message.<img

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.