View Single Post
  #4 (permalink)  
Old 06-19-07, 04:35 AM
Drunken Perl Coder Drunken Perl Coder is offline
Wannabe Coder
 
Join Date: Aug 2006
Posts: 110
Thanks: 0
Thanked 0 Times in 0 Posts
Any perl code run as a CGI will return a 500 internal server error if you don't print an http header. I assume you are just testing to see if MIME::Lite works, if so, just print a header and a short message at the end of the script.

perl Code:
  1. #!/usr/bin/perl -w
  2. use MIME::Lite;
  3.     ### Create a new single-part message, to send a GIF file:
  4.     $msg = MIME::Lite->new(
  5.         From     =>'sujata@k****ij.com',
  6.         To       =>'sujata_atkcs@yahoo.com',
  7.         Cc       =>'sujata_ghosh@hotmail.com',
  8.         Subject  =>'Helloooooo, nurse!',
  9.         Type     =>'image/gif',
  10.         Encoding =>'base64',
  11.         Path     =>'/home/k****ijc/www/com/casestudy1.gif'
  12.     );
  13.     $msg->send; # send via default
  14.  
  15. print "Content-type: text/html\n\n";
  16. print "Message sent";

Last edited by Nico; 06-19-07 at 05:18 AM.
Reply With Quote