0

Hi,

I created a script for sending mails, but I am not able to send attachments, can any one help me on that,
I am posting that created script,


print "content-type: text/html \n\n"; #The header
print "Enter full path of the file to Send :";
$filename=<STDIN>;
$myarl="$filename";
open(myarl) or die "Cant Open File!!!";
@myar=<myarl>;
[EMAIL="$myarsize=@myar"]$myarsize=@myar[/EMAIL]; #How many rows in the file

print "\nEnter the IP Address of the Exchange Server (e.g 192.168.1.51): ";
chomp($ipadr=<STDIN>);
print "\nEnter From E-Mail Id : ";
chomp($from=<STDIN>);
print "\nEnter To E-Mail Id : ";
chomp($to=<STDIN>);
print "\nEnter the Number(e.g.100) : ";
chomp($n=<STDIN>);

for ($k=1;$k<=$n; $k++)
{
use Net::SMTP;
$smtp = Net::SMTP->new($ipadr);

$smtp->mail("$from");
$smtp->to("$to");
$smtp->data();
for ($i=0;$i<=$myarsize;$i++)
{
$data=$myar[$i];
$smtp->datasend($data);
#$smtp->datasend("\n");
}

$smtp->dataend();
$smtp->quit;

close(myarl);
}


Thanks & Regards
Srinivasa Rao. Remala

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by KevinADC
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.