# ContactForm - can't find PHPMailer class

**URL:** <https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661>\
**Category:** Hosting Support\
**Created:** [April 19, 2020, 12:42pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661 "2020-04-19T12:42:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 19, 2020, 12:42pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/1 "2020-04-19T12:42:03Z")

</div>

I’ve used this Contact Form [Topic](https://forum.infinityfree.com/t/simple-contact-form-with-phpmailer/26413)

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:

 ![_localhost_submit](https://forum-cdn.infinityfree.net/original/2X/5/5adfd9b6ea8197f19aa4577fb499c0ebff6e80f6.png)

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?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [April 19, 2020, 12:49pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/2 "2020-04-19T12:49:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [April 19, 2020, 1:05pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/3 "2020-04-19T13:05:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 19, 2020, 4:58pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/4 "2020-04-19T16:58:32Z")

</div>

Thanks for the advice. Will try with ammps.

Could you decode abbreviations FW and AV?

---

<div class="post-metadata">

**Author:** ![anon57849175](https://forum.infinityfree.com/letter_avatar/anon57849175/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon57849175](https://forum.infinityfree.com/u/anon57849175)\
**Post date:** [April 19, 2020, 5:42pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/5 "2020-04-19T17:42:07Z")

</div>

> [@anon49464277](#):
>
> Could you decode abbreviations FW and AV?

I think those are respectively firewall and antivirus.

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 19, 2020, 5:56pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/6 "2020-04-19T17:56:52Z")

</div>

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?

@anon57849175 Thanks, I should have guessed)

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [April 20, 2020, 12:23pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/7 "2020-04-20T12:23:00Z")

</div>

> [@anon49464277](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 21, 2020, 11:27am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/8 "2020-04-21T11:27:55Z")

</div>

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', '');

```

---

<div class="post-metadata">

**Author:** ![anon12561907](https://forum.infinityfree.com/letter_avatar/anon12561907/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon12561907](https://forum.infinityfree.com/u/anon12561907)\
**Post date:** [April 21, 2020, 11:35am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/9 "2020-04-21T11:35:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 21, 2020, 5:52pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/10 "2020-04-21T17:52:20Z")

</div>

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);

```

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [April 22, 2020, 7:32am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/11 "2020-04-22T07:32:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 22, 2020, 9:22am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/12 "2020-04-22T09:22:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [April 22, 2020, 10:05am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/13 "2020-04-22T10:05:51Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 22, 2020, 10:27am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/14 "2020-04-22T10:27:01Z")

</div>

epiz\_25569345  
morgen

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 23, 2020, 8:07am UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/15 "2020-04-23T08:07:33Z")

</div>

@Admin any news?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [April 23, 2020, 3:27pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/16 "2020-04-23T15:27:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon49464277](https://forum.infinityfree.com/letter_avatar/anon49464277/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon49464277](https://forum.infinityfree.com/u/anon49464277)\
**Post date:** [April 23, 2020, 8:36pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/17 "2020-04-23T20:36:25Z")

</div>

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… 😕  
Anyways, it is a solution.  
The topic can be closed.

---

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [April 24, 2020, 5:47pm UTC](https://forum.infinityfree.com/t/contactform-cant-find-phpmailer-class/28661/18 "2020-04-24T17:47:11Z")

</div>


