Using Contact form Example from Github

Website URL

https://www.idev.it.com

Error Message

"title": "Error",
"type": "Error",
"code": 500,
"message": "Class \"PHPMailer\\PHPMailer\\PHPMailer\" not found",
"file": "/home/vol11_2/infinityfree.com/if0_38721712/idev.it.com/htdocs/app/Controllers/Frontend/ContactPageController.php",

Other Information

So since phpmail() is heavily restricted, I’m using Google SMTP to send mail. I’m using the contact form example on the github provided by the infinityfree in the documentation as the basis of my controller method in Code Igniter Controller Class. The example uses PHPMailer as the method to send mail using Google SMTP, but when I used PHPMailer, I got this error message. How do I make the contact form functioning? Is there any option available to me on free hosting?

Our contact form example is mainly intended to be used more or less as a standalone script. It’s not designed to be embedded in a more complex application.

If you use a more complex application, like a framework or a CMS, it usually has email functionality already built in. If so, you’ll have a much easier time by just using that built-in functionality instead of trying to hack our contact form into the framework.

A quick Google search tells me that CodeIgniter also has email functionality that supports SMTP. You can use our contact form for inspiration and to see which parameters you may need to configure, but I recommend you use CodeIgniter’s email functionality to send the messages.

7 Likes

Yeah, I switched to CodeIgniter’s built in methods.. I wasn’t sure if fsock would work or not, so that’s why I was trying to follow the github contact form, using it as an example to setup contact form for my website. The contact form is working fine, I can receive any query sent through it.

Thank you.