php_starter_sl Posted March 22, 2007 Share Posted March 22, 2007 please help me to configure this sendmail function -------------------------------------------------------------------------------------------------- function sendmail($To,$ToName,$From,$FromName,$Subject,$Message) { global $server_email_name,$sendmail_path; $m=popen("$sendmail_path -t -f $From","w"); fputs($m,"Mime-Version: 1.0\n"); fputs($m,"Content-Type: text/html; charset=utf-8\n"); fputs($m,"To: \"$ToName\" <$To>\n"); fputs($m,"From: \"$FromName\" <$From>\n"); fputs($m,"Subject: $Subject\n"); fputs($m,"Reply-to: $From\n"); fputs($m,"X-Mailer: $server_email_name Mailer\n\n"); fputs($m,"$Message"); fputs($m,".\n"); pclose($m); } --thanks-- Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/ Share on other sites More sharing options...
Lumio Posted March 22, 2007 Share Posted March 22, 2007 Why don't you use mail(); ? Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212619 Share on other sites More sharing options...
Iceman512 Posted March 22, 2007 Share Posted March 22, 2007 Hello there, Here's an easier method than you're currently using which may work... it's also easier to understand: <?php $to = "[email protected]"; // You could easily use a variable here, such as $_POST['to_email']; $subject = "Test mail"; // $_POST['subject']; $message = "Hello! This is a simple email message."; // $_POST['message_body']; $from = "[email protected]"; // $_POST['from_email']; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> I hope that helps you out. Regards, Iceman Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212645 Share on other sites More sharing options...
php_starter_sl Posted March 22, 2007 Author Share Posted March 22, 2007 Hello there, Here's an easier method than you're currently using which may work... it's also easier to understand: <?php $to = "[email protected]"; // You could easily use a variable here, such as $_POST['to_email']; $subject = "Test mail"; // $_POST['subject']; $message = "Hello! This is a simple email message."; // $_POST['message_body']; $from = "[email protected]"; // $_POST['from_email']; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> I hope that helps you out. Regards, Iceman thanks Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212675 Share on other sites More sharing options...
php_starter_sl Posted March 22, 2007 Author Share Posted March 22, 2007 Why don't you use mail(); ? thanks Lumio Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212677 Share on other sites More sharing options...
Lumio Posted March 22, 2007 Share Posted March 22, 2007 ^^ you're welcome but you got a better explanation Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212679 Share on other sites More sharing options...
Iceman512 Posted March 22, 2007 Share Posted March 22, 2007 You're very welcome... I hope it worked! Iceman Link to comment https://forums.phpfreaks.com/topic/43789-please-help-me-to-configure-this/#findComment-212861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.