title: Phpmailer not sending email on same domain
body: <p>I have a website and there is a contact form. My code below :</p>
  
  <pre><code>$name = $_POST['name'];
  $email = $_POST['email'];
  
  $mail = new PHPMailer(true);
  
  if (!$mail-&gt;addAddress('email@domain.com','email')) {
    die('Invalid email address');
  }
  $mail-&gt;isSMTP();
  //$mail-&gt;SMTPAuth = true;
  $mail-&gt;SMTPDebug = 2;
  $mail-&gt;Host = 'localhost';
  $mail-&gt;Subject = 'Subject';
  $text = 'A mail...';
  $mail-&gt;MsgHTML($text);
  $mail-&gt;SetFrom($email);
  //$mail-&gt;AddReplyTo($email,$name);
  
  if ($mail-&gt;Send()){
  </code></pre>
  
  <p>If user enter his/her mail adress like 'address@gmail.com' or 'add@hotmail.com', it sends email to that address.But if I enter my@mydomain.com, it says message send, but mail is not arrived. I'm searching for 2 days but can not found proper solution. I did also try this: </p>
  
  <p>I wroted $mail->addAddress('mybackupmail@gmail.com','email'), and I forwarded the incoming mail to mybackupmail@gmail.com to 'mydomain@domain.com'. It is also not sending. I almost tried everything. My mx records like below:</p>
  
  <p><a href="https://i.stack.imgur.com/sI9u5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sI9u5.png" alt="enter image description here"></a></p>
  
  <p>Should I change these settings or not? Or the problem with sth else?</p>
  
  <p>I would very appreciate any help.</p>
  
  <p>Thanks for interest,</p>