Swift_RfcComplianceException: Address in RFC 2822, 3.6.2

問題緣由

RFC是一個郵箱檢查規則。若是郵箱不符合規則,就會報錯。php

解決辦法

  1. 換郵箱
  2. 修改源碼,解除RFC限制
    文件目錄是:
    /vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.phpswift

    private function assertValidAddress($address)
      {
          if (!$this->emailValidator->isValid($address, new RFCValidation())) {
              throw new Swift_RfcComplianceException(
                  'Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'
              );
          }
      }

    把throw那句話註釋掉。this

相關文章
相關標籤/搜索