ContactForm - can't find PHPMailer class

I’ve used this Contact Form Topic

Removed everything that was concerned to CAPTCHA. (I don’t need it at this step)

Configured and wanted to test it, but got an error:

line 68 is :

   // Everything seems OK, time to send the email.
      $mail = new \PHPMailer\PHPMailer\PHPMailer(true); 

The class is available in this path:

    D:\xampp\htdocs\*************\vendor\phpmailer\phpmailer\src\PHPMailer.php

What is the problem? Permission?

The contact form was developed on and for Linux systems. It’s possible that I made some errors with file paths which caused it to break on Windows. But I don’t develop on Windows, so I don’t know. I’m happy to accept a pull request on the GitHub project if that’s the case.

the last time I tested (win10 64bit) everything went smoothly
but I used ammps (so try it with that) and of course pay attention if you have FW and AV (give permission for outbound traffic).

6 Likes

Thanks for the advice. Will try with ammps.

Could you decode abbreviations FW and AV?

1 Like

I think those are respectively firewall and antivirus.

2 Likes

btw, @Admin does that mean that on hosting this Form will be functional? May be I should just upload my project to hosting and try it online?

@Ergastolator1 Thanks, I should have guessed)

It should be, yes. Assuming you didn’t break the code yourself while removing the reCAPTCHA code.

Although I would recommend to keep the reCAPTCHA code in there if you don’t want your contact form to be abused by spammers.

1 Like

Understood.

But reCAPTCHA is free of charge? sry for dumb question. These lines in config.php confused me:

The reCAPTCHA credentials for your site. You can get these at 
 https://www.google.com/recaptcha/admin
 define('CONTACTFORM_RECAPTCHA_SITE_KEY', '');
 define('CONTACTFORM_RECAPTCHA_SECRET_KEY', '');

reCAPTCHA does not cost anything. Simply register an application at the link in that code and copy the two keys.

3 Likes

So, I’ve uploaded everything on hosting, but unfortunatelly form submit still doesn’t work, I get 500 Error. Code breaks indeed at $mail = new \PHPMailer\PHPMailer\PHPMailer(true);

this didn’t help either:

// The debug level for PHPMailer. Default is 0 (off), but can be increased from 1-4 for more verbose logging.
   define('CONTACTFORM_PHPMAILER_DEBUG_LEVEL', 4);

Can I check your installation to see if I can find what’s wrong with it? If so, can you please say which account username or domain name hosts the contact form?

1 Like

Sure.
Is there an option to send you somehow directly, not here in public? As I see, here is no messaging system

write here your ~epizNumber and the first three letters of the domain you are experiencing this problem (assuming the first three letters are different from your other domains/subdomains so admin can find it)
Thx !

2 Likes

epiz_25569345
morgen

1 Like

@Admin any news?

I checked your code and don’t see any obvious issues. But I did enable display errors and I now see some very strange warnings from Composer on the submit.php page.

Can you please delete the vendor folder and try to upload it again? My best guess so far is that something in there is broken.

3 Likes

So, it worked, from the 2nd attempt though. Thank you Admin for your support.
That’s odd actually, I’ve extracted vendor folder from the latest release and it was bigger by couple of bytes than mine earlier extracted, also from the same release… :confused:
Anyways, it is a solution.
The topic can be closed.

1 Like