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
Share on other sites

$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
Share on other sites

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
Share on other sites

the function if working

and I have no error

 

but I did not catch any email

 

I tried gmail - yahoo - hotmail

if its working then it is either sending to the wrong email or going into the junk/spam folder..as Webstyles said previously

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.