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);

In reply to problem on MIME::Lite..please help by bh_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.