My php file giving error 500 with phpmailer

Username (e.g. epiz_XXX) or Website URL

https://powergamesofficial.ml

Error Message

This page isn’t working
powergamesofficial.ml is currently unable to handle this request
HTTP ERROR 500

Other Information

Hi, So I am using Php mailer in my website to mail myself when someone submit the form. But when I click on submit button it gives me http error 500.
If I comment out all the line of php mailer and simply write echo “Hello World” it works but not the code of php mailer. I read the faq of http error 500 but no help :frowning: .
and also this code is working in localhost so no problem in connecting to smtp server

And enabled display errors?

1 Like

yeah that is enabled

2 Likes

this is not my answer

You cant send mail using PHP mailer. Simple as that

it uses gmail smtp

2 Likes

really? it sends in localhost i mentioned

I am using gmail smtp

Use this instead^^^

2 Likes

I am trying

not working :sob:

Are you sure that you followed that guide?

yeah, it is working in localhost but not in server

  1. Configuration of localhost isn’t as same as hosting, because it works on localhost but not here it doesn’t mean there’s an issue with our servers,but your code needs to be reconfigured.

  2. Are there some php code or htaccess which disables displaying errors? Because you say you have enabled display errors but it still returns 500, there must be something with your code ir your htaccess file.

4 Likes

i don’t have a .htaccess file

Hmm, you have enabled display errors but there’s no htaccess file i see.

Create a file named .htaccess and put this in the file:

php_flag display_errors on
3 Likes

ok let me see

wow i got error

Please upload all of the phpmailer files. It clearly says some of your files are missing.

4 Likes