tlovett1 / custom-contact-forms

Build beautiful custom forms and manage submissions the WordPress way.
https://taylorlovett.com
161 stars 50 forks source link

Subject line is going into the "From" header, causing PHPMailer a fatal error #286

Open tomasanjosbarao opened 8 years ago

tomasanjosbarao commented 8 years ago

My form submissions are being stored in the database, but the e-mails are not being sent. Something is going wrong in the logic of the file class-ccf-form-handler.php: somehow, the subject line is getting into the "From" header. If I var_dump($headers) at line 1053 in that script, the headers are as follows, "Lorem Ipsum" being my subject line:

array (size=3)
  0 => string 'MIME-Version: 1.0' (length=17)
  1 => string 'Content-type: text/html; charset=utf-8' (length=38)
  2 => string 'From: Lorem Ipsum <>' (length=16)

PHPMailer then encounters this invalid "From" address and throws a "Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: ' in C:\wamp\www\gmdup\wp-includes\class-phpmailer.php:946"

Thanks for the awesome plugin, Taylor!