473,549 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MIME::Lite HTML message handling

I am working on the code below:
*************** *************** *************** *********
use strict;
use MIME::Lite;
use Net::SMTP;
my $from = 's****@earthlin k.net';
my @addweek1 = qw(mi*****@eart hlink.net
je******@aol.co m
);
my $Fnameweek1 = 'JNIssue11.pdf' ;
my $subject='Issue 11';
my $message = 'C:\\message1.h tml';
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\\JNI ssue11\\$Fnamew eek1",
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.h tml', I
wish qq{$message reads the contents of c:\message1.htm l.

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 7007
John B. Kim wrote:
my $message = 'C:\\message1.h tml';
...
$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
5383
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 send out the emails. Unfortuantely, whenever I do so, it gets bounced by the program as an invalid email address. For example, this works: $msg =...
3
2733
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 the images (each in a MIME part). The MIME part for the image looks like some sort of abreviated compressed code. Does anyone know how to extract...
13
5193
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 me to solve this kind of problem? thank you the coding i made----->: <?php $a=<<<A
3
2006
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 anyone tell me how to write the coding!! Thanks in Advance!!!
1
2733
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 multi-attached docs. 2. Able to set priority to mail. 3. Able to send inline images. Please suggest some python modules which satisfies above...
0
1331
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 Microsoft.Exchange.data.Mime namespace and I am also able to decode the message if it doesn't contain an attachment . But , for a TNEF encoded message without...
2
1344
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 encoding should be null). Is there a way to construct the flattened MIME message such that data is streamed from the file as needed instead of being...
1
2550
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 = "xxx\@xxxxx.com.br"; my $subject = "ficheiro audio "; my $message = "ficheiro audio "; my $path =...
5
7774
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 examples of attachment scripts. Unfortunately, i have had no luck trying to execute my script. Every time i attempt to execute the script i...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.