I have been ripping my hair out trying to resolve this issue and after days of trying it's now time to ask for some help.
Basically I have a form that I have adapted from this script.
Now, the form is functioning almost correctly, just a few tweaks on my part. But when I test the form it sends to the person sending the form, but it does not send to me.
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = I used the correct port number here; // set the SMTP server port
//$mail->Host = "mysmtpserverhost"; // SMTP server
//$mail->Username = "email@example.com"; // SMTP server username
//$mail->Password = "mypassword"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
Difference between those two :
//Set an alternative reply-to address $mail->addReplyTo('firstname.lastname@example.org', 'First Last'); //Set who the message is to be sent to $mail->addAddress('email@example.com', 'John Doe');
This link will be helpful for you.