• Resolved johnda

    (@johnda)


    Hello guys,

    I am building my forms in my website and after some work I went ahead and tried to submit a message and unfortunately I am getting fatal errors again [again because I was getting them on other occasions and I had to update to php 8 from 7.4 according to my host , problems went away but not with contact form 7 again these arise. I went ahead and also checked another contact form which also gave me an error without specifying the actual error like cf7 did. Please note that , previously I went through the css js loading only when necessary with:

    if (!is_front_page() && !is_home() && is_page() ) {
    if ( function_exists( ‘wpcf7_enqueue_scripts’ ) ) {wpcf7_enqueue_scripts();}
    if ( function_exists( ‘wpcf7_enqueue_styles’ ) ) {wpcf7_enqueue_styles();}
    }
    In functions.php
    and

    define( ‘WPCF7_LOAD_JS’, false );

    define( ‘WPCF7_LOAD_CSS’, false );

    in wp-config.php .

    I tried to erase these functions as this is the only step I took in terms of coding and the error would not appear anymore but then again another issue arose, the one of the gray spinning wheel without a delivery message or any other activity.

    So, I would prefer to keep the js and css load off on the frontpage if possible and get rid of the following error.

    ”`Fatal error: Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php:872 Stack trace: #0 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1899): PHPMailer\PHPMailer\PHPMailer->mailPassthru() #1 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1639): PHPMailer\PHPMailer\PHPMailer->mailSend() #2 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1470): PHPMailer\PHPMailer\PHPMailer->postSend() #3 /home/mywebsite/public_html/wp-includes/pluggable.php(531): PHPMailer\PHPMailer\PHPMailer->send() #4 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/mail.php(194): wp_mail() #5 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/mail.php(19): WPCF7_Mail->compose() #6 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(475): WPCF7_Mail::send() #7 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(93): WPCF7_Submission->mail() #8 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(25): WPCF7_Submission->proceed() #9 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/contact-form.php(763): WPCF7_Submission::get_instance() #10 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/controller.php(25): WPCF7_ContactForm->submit() #11 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(290): wpcf7_control_init() #12 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #13 /home/mywebsite/public_html/wp-includes/plugin.php(551): WP_Hook->do_action() #14 /home/mywebsite/public_html/wp-includes/class-wp.php(388): do_action_ref_array() #15 /home/mywebsite/public_html/wp-includes/class-wp.php(750): WP->parse_request() #16 /home/mywebsite/public_html/wp-includes/functions.php(1291): WP->main() #17 /home/mywebsite/public_html/wp-blog-header.php(16): wp() #18 /home/mywebsite/public_html/index.php(17): require(‘/home/mywebsite/…’) #19 {main} thrown in /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php on line 872

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.`”

    Please help.

    Thanks

    John

    • This topic was modified 4 years, 12 months ago by johnda.
Viewing 5 replies - 1 through 5 (of 5 total)
  • hi @johnda,

    it seems you have an unconfigured smtp plugin… 😶 is my assumption correct?

    Thread Starter johnda

    (@johnda)

    Hi Erik,

    I am using 4 plugins. Litespeed cache , kadence blocks , wp grid builder and contact form 7 for now. For mail server I use roundcube I have created one mail account in my hosting provider like this contact@mywebsite and changed the mx and txt in cloudflare and have the mail settings in cf7 to send to contact@mywebsite.

    I also saw the same message when I wanted to change the adminstrator email address to my new contact email , so I suppose there must be a connection , something is happening with the mails

    yes, it seems something related to your smtp server.

    You can try with an smtp plugin, it can me more easier to debug because you will see the responses.

    Anyway it doesn’t seems related to the previous code, removing it and nothing happens is fairly illustrative.

    Thread Starter johnda

    (@johnda)

    Hi Erik,

    I must clarify that when I removed the previous code, the fatal error would not appear , only the grey circle with a flashing white dot would , after clicking the submit button and thats it , nothing happens after that. So with js css loading false code I get the fatal error, without the code I get the grey circle and nothing happens , no message of a successful submission.
    Although , since I saw a similar error in settings administrator email when I wanted to change it , I went now and checked again with the code removed , eventhough the error is not showing in contact form 7 submit anymore , a similar phpmailer error will appear when I want to change the admin email.

    Thread Starter johnda

    (@johnda)

    Ciao Erik,

    I was tired yesterday and didn’t quite understand your point to use smtp. I went ahead and configured an smtp server and now everything works fine.

    Thanks again.

    John

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Fatal error: Uncaught Error: Call to undefined function PHPMailer’ is closed to new replies.