title: PHP mail() function returns 1 but no mail is sent despite configuring XAMPP
body: <p>In a PHP application during the sign up step, I'm sending an email with a verfication link to the user. I'm using XAMPP in localhost to serve the page, and my database is in another device but in the same network. When I fill the form and hit the sign up button, I get a success message, the database is updated but no email is received to my address. I've searched for answers and found out that I had to configure <code>php.ini</code> and <code>sendmail.ini</code> properly in order for it work and I did that as well but still no mail is send. Can anyone explain why is this happening? Below are the configurations of both <code>php.ini</code> and <code>sendmail.ini</code> as there is no problem with my signup.php since the database is updating.</p>
  
  <p><strong>sendmail.ini</strong></p>
  
  <pre><code>[sendmail]
  smtp_server= smtp.mail.yahoo.com
  
  smtp_port=465
  
  smtp_ssl=ssl
  
  ;default_domain=mydomain.com
  
  error_logfile=error.log
  
  ;debug_logfile=debug.log
  
  auth_username=mymail@yahoo.com
  
  auth_password=mypassword
  
  pop3_server=
  
  pop3_username=
  
  pop3_password=
  
  force_sender=mymail@yahoo.com
  
  force_recipient=
  
  hostname=
  
  
  
  </code></pre>
  
  <p><strong>php.ini</strong></p>
  
  <pre><code>
  [mail function]
  SMTP= smtp.mail.yahoo.com
  
  smtp_port=465
  
  sendmail_from = mymail@yahoo.com
  
  sendmail_path = "\"C:\Users\GMKRG\Desktop\xampp\sendmail\sendmail.exe" -t"
  
  ;mail.force_extra_parameters =
  
  mail.add_x_header=Off
  
  mail.log = "\"C:\Users\GMKRG\Desktop\xampp\sendmail\error.txt"
  
  ;mail.log = syslog
  </code></pre>
  
  <p>I've also configured my yahoo account to accept mails from less secure apps but still no mail received. Thanks in advance.</p>
  
  <p><strong>EDIT:</strong>
  <strong>Below is the php mail function in case it helps more.</strong></p>
  
  <pre><code>$email = mysqli_real_escape_string($connection, $mailString);
  $emailBody = "Please click on the link below to activate your account:\n\n";
  
  $emailBody .= "localhost/website/activate.php?email=" . urlencode($email) . "&amp;key=$activationKey";
  
  if(mail($email, 'Confirm your registration', $emailBody, 'From:'.'myaddress@yahoo.com')){
  
      echo "&lt;div class='alert alert-success'&gt;Thank you for registering. A 
             confirmation email has been sent to $email. Please click on the 
             activation link inside it to activate your account.&lt;/div&gt;";
  }
  </code></pre>