Jump to content

Email() function


vividona

Recommended Posts

I don't know why refuse to send email

 


$to = "To: ".$em."";
	$subject = $txt3;
	$message = "".$txt4."";
	$headers = "From:".$txt2." <".$txt2.">" . "\r\n" .
	"Reply-To: ".$txt2." <".$txt2.">" . "\r\n";
	$headers .= "MIME-Version: 1.0\n";
	$headers .= "Content-Type: text/html; charset=utf-8\n";
	$headers .= "\r\nX-Mailer: PHP/" . phpversion();
	$headers .= "X-Mailer: PHP/" . phpversion()."\r\n";

	mail($to, $subject, $message, $headers);


Link to comment
https://forums.phpfreaks.com/topic/243817-email-function/
Share on other sites

  Quote

$to = $em;

 

I changed it like this

 

$to = $em;
$subject = $txt3;
$message = "".$txt4."";
$headers = "From:".$txt2." <".$txt2.">" . "\r\n" .
	"Reply-To: ".$txt2." <".$txt2.">" . "\r\n";
	$headers .= "MIME-Version: 1.0\n";
	$headers .= "Content-Type: text/html; charset=utf-8\n";
	$headers .= "\r\nX-Mailer: PHP/" . phpversion();
	$headers .= "X-Mailer: PHP/" . phpversion()."\r\n";

mail($to, $subject, $message, $headers);

 

$em is my email which I fetch it from database.

Link to comment
https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251862
Share on other sites

  Quote

  Quote

1. what errors do you receive?

2. some of your syntax is incorrect

for doumentation on the mail function

 

No error

 

which one that is incorrect?

if the mail function is not working, it will output errors to the error.log, do you have error_reporting set to E_ALL?

ini_set("error_reporting",E_ALL);

Link to comment
https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251878
Share on other sites

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.