RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Generate Email script

Join Date: Apr 2007
Posts: 9
Reputation: tomf is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tomf tomf is offline Offline
Newbie Poster

Generate Email script

  #1  
May 2nd, 2007
How can i make this script work?
It is meant to send an email to a person with a confirmation code, but it is not working. whats wrong with it?

 <?php

 function send_mail($fromname,$frommail,$to,$subject,$body,$priority)
  {
    $fullmail = "\"$fromname\"<$frommail>";
    $headers  = "From: $fullmail\n";
    $headers .= "X-Sender: $fullmail\n";
    $headers .= "X-Mailer: PHP\n";
    $headers .= "X-Priority: $priority\n";
    $headers .= "Return-path: $fullmail\n";

    mail($to,$subject,$body,$headers);
  }

 function send_html_mail($fromname,$frommail,$to,$subject,$body,$priority)
  {
    $fullmail = "\"$fromname\"<$frommail>";
    $headers  = 'MIME-Version: 1.0' . "\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
    $headers .= "From: $fullmail\n";
    $headers .= "X-Sender: $fullmail\n";
    $headers .= "X-Mailer: PHP\n";
    $headers .= "X-Priority: $priority\n";
    $headers .= "Return-path: $fullmail\n";

    mail($to,$subject,$body,$headers);
  }

?>
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:52 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC