I recently installed mail into my php, I can send mail when I do it on my command server but when I use it on php, I dont receive an email
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require "connection.php";
$email = $_POST['email'];
if(isset($_POST['submit']))
{
$check = mysqli_query($conn, "select * from users where email = '$email' ");
$row = mysqli_fetch_array($check);
$message ="Please click here to create a new password www.jasmine.com/id?=" . $row['id'];
$subject = 'Change password';
$body = "E-Mail: $email\n Message:\n $message";
if($row)
{
$res = mail ($email, $subject, $body);
var_dump($res);die;
echo "Please check your email";
}
}
else
{
echo "Email Not Found";
}
?>
I researched all over this website, but I found nothing to help me I tried 1) to see if port 25 was blocked, it was not. 2) I tried this code to see if anything would send :
<?php
mail('youremailaddress@here.com','Test Email','Testing to see if this comes through');?>
Nope it didnt 3)when I do telnet domain.com 25 I just get
Trying IP...
telnet: connect to address IP: Connection refused )
[root]# netstat -plnt |grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1228/master
tcp6 0 0 ::1:25 :::* LISTEN 1228/master
Is there anything else I could do to actually get it working, I installed mail by using the steps on this website, and it should have all worked fine http://www.tecmint.com/setup-postfix-mail-server-smtp-using-null-client-on-centos/