Thanks a lot!
yes i am getting email but as i have not added anything to display on the screen so i was getting error message. now it's working. now i need to know some more info,
1) the email script i was using which take data from diffent variable as follows:
perl Code:
sub send_mail{
my @boundaryv = (0..9, 'A'..'F');
$PREF{'FOOTER'} =~
s/\\n/\n/g;
$| = 1;
my @boundaryv = (0..9, 'A'..'F');
for (my $i = 0; $i++ < 24;)
{
$boundary .= $boundaryv[rand(@boundaryv)];
}
#foreach my $file (@files)
#{
do { push @problem,
"$file";
next;
} if !-r
"$upload_dir/$file";
# checks the existence and readability #--------------------------------------------------- Obtain content-type of file
($ext) =
$file =~
m,\.
(&
#91;^\.]*)$,; my $fext = $mime{$ext};
#--------------------------------------------------- Generate multipart boundary
for (my $i = 0; $i++ < 24;)
{
$boundary .= $boundaryv[rand(@boundaryv)];
}
#--------------------------------------------------- Send attatchments etc...
open MAIL,
"| $mail_prog -finrreturn\@k****ij.com" ||
die "I was not able to open the mail program<BR>contact the server's technical administrator.<BR><BR>If this is not admin, please let him/her<BR> know about this problem.";
print MAIL
"From: Vikram Murarka <vikram\@k****ij.com>\n";
print MAIL
"Return-Path: Vikram Murarka <vikram\@k****ij.com>\n";
print MAIL
"Reply-To: Vikram Murarka <vikram\@k****ij.com>\n";
print MAIL
"X-Mailer: Custom-CGI: Web Mailer v1.02\n";
print MAIL
"MIME-Version: 1.0\n";
print MAIL
"Subject: $INPUT{'subject'}\n";
print MAIL
"Content-Type: multipart/mixed; boundary=\"------------$boundary\"\n";
print MAIL
"This is a multi-part message in MIME format.\n";
print MAIL
"--------------$boundary\n";
print MAIL
"Content-Type: text/plain; charset=us-ascii\n";
print MAIL
"Content-Transfer-Encoding: 7bit\n\n";
print MAIL
"$subject \n";
if (!$edition)
{
$edition = "";
}
else
{
print MAIL
"$edition \n";
}
if ((!$inr1) && (!$inrm1))
{
$inr1 = "";
$inrm1 = "";
}
else
{
}
if ((!$fwd1) && (!$fwdm1))
{
$fwd1 = "";
$fwd1 = "";
}
else
{
print MAIL
"$fwdm1\n\n\n";
}
if ((!$strategy1) && (!$strategym1))
{
$strategy1 = "";
$strategym1 = "";
print MAIL
"$strategym1";
}
else
{
print MAIL
"$strategy1\n";
print MAIL
"$strategym1\n\n";
}
if ((!$eurrs1) && (!$eurrsm1))
{
$eurrs1 = "";
$eurrsm1 = "";
}
else
{
print MAIL
"$eurrsmail2\n\n";
print MAIL
"$eurrsmmail2\n\n\n";
}
}
sub encode_base64 #($)
{
my ($res,
$eol,
$padding) =
("",
"\n",
undef);
while (($_[0] =~ /(.{1,45})/gs))
{
}
$res =~
tr#` -_#AA-Za-z0-9+/#; # ` help emacs $padding =
(3 -
length($_&
#91;0]) % 3) % 3; # fix padding at the end $res =~
s#.{$padding}$#'=' x $padding#e if $padding; # pad eoedv data with ='s $res =~
s#(.{1,76})#$1$eol#g if (length $eol); # lines of at least 76 characters }
now how i will converted into it:
perl Code:
#!/usr/bin/perl -w
use MIME::Lite;
my $message_body = "Here's the attachment file(s) you wanted<br><b>h</b>";
### Create a new single-part message, to send a GIF file:
$msg = MIME::Lite->new(
From =>'sujata@k****ij.com',
To =>'sujata_atkcs@yahoo.com',
Cc =>'sujata_ghosh@hotmail.com, [EMAIL="sujata_ghosh1@rediffmail.com'"]sujata_ghosh1@rediffmail.com'[/EMAIL],
Subject =>'Helloooooo, nurse!',
Type =>'application/octet-stream',
Encoding =>'base64',
Path =>'/home/k****ijc/www/temp/inr rates.xls'
);
$msg->attach (
Type => 'text/html',
Data => $message_body
) or die "Error adding the text message part: $!\n";
$msg->send; # send via default
print "Content-type: text/html\n\n";
print "Message sent";
2) i am using a script which take data from form and make HTML page and send HTML mail using same email script and additional code only i change the 'text/html' part this email message consist of images which appears with email body message, but it is not showing into email. as we are using this code to display it on HTMl page: (<img src="full path of the file">) how i will use the same to display it on proper place in the email body with text?
Thanks once again.