Naniman
0
Q:

php test if mail is working

filter_var($email, FILTER_VALIDATE_EMAIL)
4
<?php 
$email = "[email protected]";
$subject =  "Email Test";
$message = "my mail test message";
$sendMail = mail($email, $subject, $message);
if($sendMail){ 
	echo "Email Sent Successfully";
}else{
	echo "Mail Failed";
}
#If the mail() function exist but mails not going, check if a mail transport agent (MTA)such as sendmail or postfix is installed on your server
?>
0

New to Communities?

Join the community