http://qs1969.pair.com?node_id=876395

bh_perl has asked for the wisdom of the Perl Monks concerning the following question:


hi..

I have a text file contain some info as below:-
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;RM2 +01.99;12/12/2010;12/1/2011

Based on my program, i want all the information from the input data and send email using MIME::Lite. But my code look failed and it was not send the email.. WHY ?...please help me.. is there any missing on my code </code>
#!/usr/bin/perl use MIME::Lite; open (DATA, "/home/ftpadmin/email.txt"); open (LOG, ">> /root/bin/email.log"); while (my $line = <DATA>) { chomp($line); my ($id,$attach,$name,$acc_no,$amount,$sdate,$ddate) = split(/ +;/,$line); print (LOG localtime . ",$id,$attach,$name,$acc_no,$amount,$sd +ate,$ddate\n"); $msg = MIME::Lite->new( To =>'$id', From =>'"DATAONE SDN BHD"<admin@dataone.asia>', Subject =>'TEST ON $sdate', Type =>'multipart/related' ); $msg->attach( Type => 'text/html', Data => qq{ <head> <title>TEST ON $sdate</title> </head> <body> <center> <table border=0> <tr> <th><img border=0 src=/images/pulpit.jpg alt=Pulpit rock w +idth=67 height=92 /></th> <th><p>&nbsp;</p> <h2>Bill Statement</h2></th> </tr> <tr> <td><h4>Dear $name,</h4> <p>Thank you for your valued subscription to our<br/> services.Your TM bill statement is now attached as <br/> an Adobe PDF file in this email.</p> <p>Thank You</p></td> <td><p>Account No.</p><p>$account</p>Statement Date.<p>12/ +12/2010</p></td> </tr> </table> <center><img src=example.jpg alt=example/></center> </center> </body> }, ); $msg->attach( Type => 'image/gif', Id => 'image.gif', Path => '/tmp/image.gif', ); $msg->send(); } close(DATA); close(LOG);