Help us understand the problem. What is going on with this article?

WordpressのPHPMailerのアドレス形式チェックをはずす

More than 3 years have passed since last update.

Wordpressのメール送信関数 wp_mail()
PHPMailerを使っている。

docomoとauは

  • @の前に「.」
  • 「.」の連続

という気持ち悪い形式のアドレスが作れてしまい、
かつ、割とユーザーがこの形を使いたがるため、
PHPMailer内の形式チェックをはずさなければならない。

PHPMailerでドットが連続しているアドレスにメール送信できない

上記記事の通り、
/wp-includes/class-phpmailer.php
の986行目あたりの
public static function validateAddress($address, $patternselect = 'auto')

public static function validateAddress($address, $patternselect = 'noregex')
とすることで無事送信することができた。

また、wp_mail()を使う際、
WP Mail SMTP
がSMTP使えて、テストもできるのでおすすめ。

ki6ool
絶対ワードプレス使うマン
https://6oolab.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした