473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MIME::Lite HTML message handling

I am working on the code below:
************************************************** ****
use strict;
use MIME::Lite;
use Net::SMTP;
my $from = 's****@earthlink.net';
my @addweek1 = qw(mi*****@earthlink.net
je******@aol.com
);
my $Fnameweek1 = 'JNIssue11.pdf';
my $subject='Issue 11';
my $message = 'C:\\message1.html';
for my $address (@addweek1) {
my $msg = MIME::Lite->new (
From => $from,
To => $address,
Subject => $subject,
Type =>'multipart/related');

$msg->attach (
Type => 'text/html',
Data => qq{$message});

$msg->attach (
Type => 'x-pdf',
Path => "c:\\guide\\JNIssue11\\$Fnameweek1",
Filename => $Fnameweek1);
MIME::Lite->send('smtp', 'smtp.earthlink.net');
$msg->send();
}
***************************************
The above codes attach the pdf file I have in my hard drive and send the
email to multiple recepients with pdf attachments. Now I use this codes to
send messages with different attachments and different HTML messages to the
same group of recipients. With the codes above I can just change the name
and location of new attachment with different version of emailing, but for
now I have to always copy and paste lengthy html message after qq{..

What I would like to realize is through my $message = 'C:\\message1.html', I
wish qq{$message reads the contents of c:\message1.html.

However, when I run the above codes, rather than seeing the html message in
the email body, I just see c:\message.html in the body of the email sent.

It probably is something simple for an experienced Perl programmer, but as a
beginer, I cannot figure what to put after Data => qq{ so that the content
of c:\message.html be place as email body.

Any help will be deeply appreciated. I hope my message is clear enough so
that people understand what I am struggling about.


Jul 19 '05 #1
1 6985
John B. Kim wrote:
my $message = 'C:\\message1.html';
...
$msg->attach (
Type => 'text/html',
Data => qq{$message});


Have you tried changing that to
Path => $message,
Filename => $message;
-Joe
--
I love my TiVo - http://www.inwap.com/u/joe/tivo/
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Zev Steinhardt | last post by:
I'm trying to use Mime::Lite to send out multipart messages. So far, it all seems to work well except for one small part. I want to display a "real name" along with the email address when I...
3
by: John Mark Howell | last post by:
I've got a MIME message that was originally an HTML email with embedded images. When the email is received (to GMail) it is now in MIME format. The HTML portion is now split out into the HTML and...
13
by: stam | last post by:
hello guys, i have met a problem that i can send the html e-mail by using MIME via php to yahoo mail and hotmail, but when i was try to send to gmail, it show all the html coding. can someone help...
3
by: ramyaamar | last post by:
Hii friends I m new to perl...Just started learning....I want to know how to send an simple email in perl... I have activex perl and downloaded MIME::LITE and Mail:Mailer modules.... Can...
1
by: munisams | last post by:
Can anyone tell me Is there any python module available which functionally equivalent to Perl's MIME::Lite?? I am searching for a python MIME module which has following features: 1. Able to send...
0
by: shilpab | last post by:
My query is regarding the decoding classes available in Exchange 2007. I am working on a problem where I want to decode a TNEF encoded MIME message. I am using the class Base64Decode in...
2
by: Kris Kennaway | last post by:
I would like to MIME encode a message from a large file without first loading the file into memory. Assume the file has been pre-encoded on disk (actually I am using encode_7or8bit, so the...
1
by: jcor | last post by:
Hi, I'm trying to create a script that send a file in attachment of a mail: my code is something like this: #set up email my $to = "xxx\@xxxxxx.com"; my $from =...
5
by: xmaverick | last post by:
Hello, I'm a newbie to perl and i'd like some assistance trying to figure out how to send an attachment using MIME::Lite. I have searched the net far and wide and have used and modify different...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.