I have a simple website set up on godaddy, decided to add emails straight to me instead of through godaddy, started using the phpmailer and I only receive emails from users submitting on my website form if they send an email with gmail. All other emails get ignored. Wonder if it's a godaddy issue.
$connect = mysqli_connect('localhost', 'pf', '*********', 'bs-portf');
if(mysqli_connect_errno()){
echo "Failed to connect" . mysqli_connect_error();
}
if(mysqli_ping($connect)){
// echo "we are connected";
}else{
echo "Error: ". mysqli_error($connect);
die("Connection failed");
}
?>
<?php
if(isset($_POST['submit'])){
require 'phpmailer/PHPMailerAutoload.php';
$mail = new PHPmailer();
$name = $_POST['name'];
$email = $_POST['email'];
$message = nl2br($_POST['message']); //nl2br() new lines in text message to break tags
$mail->Host='smtp.gmail.com';
// $mail->isSMTP();
$mail->Port=465;
$mail->SMTPAuth=true;
$mail->SMTPsecure='ssl';
$mail->Username='bradv@gmail.com';
$mail->Password='**********';
$mail->setFrom($email, $name);
$mail->addAddress('bradv@gmail.com');
$mail->addReplyTo('info@example.com', 'Information');
$mail->isHTML(true);
$mail->Subject='Form Submission';
$mail->Body= "test email body 1";
// $mail->Body='<p align=center>Name :'.$name. '<br>Email: '.$email.
'<br>Message '.$message. '</p>';
// echo "submit worked";
if($mail->send()){
echo 'mail is sent';
// $result ="Something went wrong. Please try again.";
}else{
echo 'email failed';
// $result="Thanks " .$name. " for contacting us. We'll get back to you
soon!";
}