0

I want to sent email which have three dots : example testing.app.forward.123@gmail.com but the Email doesn't sent. but If there is like testing.app.forward@gmail.com it works.

I want to know what is happening...

I am using pure PHP Mail. This is my Code.

Thanks you in advance.

    $email_message = "自動通知メールのため、当メールアドレスへの返信はできません。 \n返信をご希望の場合は「info@pwr.co.jp」までご連絡をお願いいたします。"  . "\n\n";

    $email_message .= "以下の内容でご確認させていただきます。 "  . "\n";
    $email_message .= "--------------------------------------"  . "\n";
    $email_message .= "あなたのOTP: " . $otp . "\n";
    $email_message .= "--------------------------------------"  . "\n\n";
    $email_message .= "弊社より一週間以内に返信がなければ、お手数ですが「info@hello.co.jp」までお問い合わせください。"  . "\n";
    $email_subject = '「Hello」OTPコード';
    // create email headers
    $headers = 'From: ' . "info@hello.fun" . "\r\n" .
        'Reply-To: ' . "info@hello.co.jp" . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    mail($request->email, $email_subject, $email_message, $headers);

I want to know how to fix. I have tried testingappforward@gmail.com, testingapp.forward@gmail.com and testing.app.forward@gmail.com and It works.

Sammitch
  • 30,782
  • 7
  • 50
  • 77
  • 2
    "the Email doesn't sent" How do you know? Have you looked at the logs of your MTA (sendmail, exim, dovecot or whatever)? – Peter Jun 26 '23 at 16:06
  • What does `mail()` return? If it returns `true`, then PHP successfully passed the email along to `sendmail` (or what ever mta you're using) and considers it a success. What happens after that is out of PHP's hands (unless you passed in bad data from PHP, which I hope you already checked for). Btw, why aren't you using Laravel's mail-library instead of the low level `mail()`-function? – M. Eriksson Jun 26 '23 at 16:50
  • While gmail ignores dots in the user portion, it doesn't ignore anything else and `testingappforward@gmail.com` and `testingappforward123@gmail.com` are completely different email accounts. There is also no limit to the number of dots in the user portion. Check your email logs for the _actual_ error. – Sammitch Jun 26 '23 at 18:11

0 Answers0