Address in mailbox given [] does not comply with RFC 2822, 3.6.2. when email is in a variable

后端 未结 13 2256
执笔经年
执笔经年 2020-12-16 09:52

I have a correct email address. I have echoed it, but when I send it, I get the following error:

 Address in mailbox given [] does not comply with RFC 2822,          


        
13条回答
  •  生来不讨喜
    2020-12-16 10:28

    (I'm using SwiftMailer in PHP)

    I was getting an error like that when I was accidentally sending a string for $email

    $email = "someone@somewhere.com ";
    

    When what I meant to be sending was

    $email = Array("someone@somewhere.com"=>"Some One");
    

    I was accidentally running it through a stringify function that I was using for logging, so once I started sending the array again, the error went away.

提交回复
热议问题