Jump to content

please help me to configure this


php_starter_sl

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.