Home  >  Q&A  >  body text

Send email on PHP using XAMPP

I'm trying to send an email from no-reply@{domain} to my Gmail mailbox. I don't get any errors, just the emails don't arrive in my Gmail.

My PHP code looks like this:

<?php mail('[email protected]', 'Test Email', 'Hello World', 'From: John Doe <no-reply@{domain}>'); ?>

I have set up php.ini like this:

[mail function]
SMTP=mail.{domain}
smtp_port=25
sendmail_from=no-reply@{domain}
mail.add_x_header=Off

In my domain's DNS settings, I have a MX @ 10 mail.{domain} entry. I don't know if this matters, but I already have hMailServer installed. Receiving emails is already available.

P粉368878176P粉368878176259 days ago328

reply all(1)I'll reply

  • P粉299174094

    P粉2991740942024-02-27 15:25:13

    I think this is Google's own email protection. You can get more information about it here: https://support.google.com/mail/answer/81126?hl= zh

    reply
    0
  • Cancelreply