isp:/home/ftpadmin # more email.txt baharin.hasan@gmail.com;/tmp/hisyam/test.txt;BAHARIN HASAN;12345;RM101.99;12/12/2010;12/1/2011 asmah@impressivecomm.com;/tmp/hisyam/test.txt;ASMAH AHMAD;12345;RM111.99;12/12/2010;12/1/2011 hisham@impressivecomm.com;/tmp/hisyam/test.txt;HISHAM SALLEH;12345;RM201.99;12/12/2010;12/1/2011 #### #!/usr/bin/perl use MIME::Lite; open (DATA, "/home/ftpadmin/email.txt"); open (LOG, ">> /root/bin/email.log"); while (my $line = ) { chomp($line); my ($id,$attach,$name,$acc_no,$amount,$sdate,$ddate) = split(/;/,$line); print (LOG localtime . ",$id,$attach,$name,$acc_no,$amount,$sdate,$ddate\n"); $msg = MIME::Lite->new( To =>'$id', From =>'"DATAONE SDN BHD"', Subject =>'TEST ON $sdate', Type =>'multipart/related' ); $msg->attach( Type => 'text/html', Data => qq{ TEST ON $sdate
Pulpit

 

Bill Statement

Dear $name,

Thank you for your valued subscription to our
services.Your TM bill statement is now attached as
an Adobe PDF file in this email.

Thank You

Account No.

$account

Statement Date.

12/12/2010

example/
}, ); $msg->attach( Type => 'image/gif', Id => 'image.gif', Path => '/tmp/image.gif', ); $msg->send(); } close(DATA); close(LOG);