September 10, 2019 at 4:15 pm #10030713
I am experiencing an Error when trying to forward a message using the Contact Form. The error is as follows.
PHPMailer.php on line 304. Would you happen to know what could be causing this?
September 10, 2019 at 10:45 pm #10030716
The issue is the PHP version of your server. The PHPMailer needs a minimum version of PHP 5.5 to works.
Just update the PHP version in your server and the contact form should works.
Please try that and let us know if you need further assistance.
September 11, 2019 at 4:03 am #10030721
I wasn’t aware. Site was running off PHP3. I have now updated to PHP6.
Not sure if it takes a while for it to kick over? But the error is still occurring. Is there another file I need to update other than contact.php?
September 11, 2019 at 5:25 am #10030726
We did a new test and now the issue PHP version is resolved.
Still it’s returning error but it’s not related to the PHP version.
Try the instructions on the faq topic below:
If still not resolver your issue, please send all code of your
contact-form.phpfile for us. You can use a service like https://pastebin.com to create a link with your code and share with us.
Please, try that and let us know if you need further assistance.
September 11, 2019 at 7:24 am #10030730
I keep getting an error! And according to the referral notes…
“For emails that are not in the same server as the website (www)) – Uncomment the settings and add the parameters for the SMTP authentication (Make sure you enter the correct settings, contact your email provider to get that information)”
My email is under the same server… email@example.com… Could the issue be that my site is going through https server?
Thanks… I haven’t had this problem before the update… Don’t know why it’s happening now?
September 11, 2019 at 10:10 pm #10030733
This is possible.
In that case my suggestion for you is try using the SMTP settings (get the correct settings with your hosting provider).
If even so not works, then set the
$debug = 2and paste the error for us here. Also (if smtp not works) send all code of your
contact-form.phpfile for us.
September 12, 2019 at 9:18 am #10030747
All well and good. But I’m not understanding something.
The old version before the upgrade worked fine.
Was there anything different that was done?
And by the way I already changed to $debug = 2.
Just trying to understand.
September 12, 2019 at 10:32 pm #10030753
THe problem is solved ? I did a new test and seems to be not.
Probably it’s related to some setting in your server that not works with the default PHP mail() function with HTTPS.
OBS: If the contact form it’s working, change the
$debug = 0;. If you mantain with
2always will return error on the front end (even receiving the emails)
September 13, 2019 at 5:04 am #10030755
It’s now sending and notification it was sent…
But when I check email the following error appears in subject line:
Define subject in php/contract-form.php line 29.
And with in the contact PHP notes…
// If contact form don’t has the subject input change the value of subject here
$subject = ( isset($_POST[‘subject’]) ) ? $_POST[‘subject’] : ‘Define subject in php/contact-form.php line 29’;
How do I change value?
It appears this error is showing because Subject Line is not being used in Contact Form. https://codenyc/net.
As of right now, mail is showing up as spam…
Thanks again for all your help!
September 13, 2019 at 5:16 am #10030756
Regarding the subject you are right. This occurs because you don’t have a field for subject on the contact form.
In that case you can just change the string/text with your appropriate subject, for example:
$subject = ( isset($_POST[‘subject’]) ) ? $_POST[‘subject’] : ‘Contact Form Received!’;
Unfortunately this is not controlled on the website code side, but yes trough the server settings. We recommend you contact your hosting provider to check why the emails are being added to the spam folder.
We hope this helps.
September 13, 2019 at 5:25 am #10030757
Yep that was it…
Awesome!! Thank you Rodrigo.