mail() on php 7

Paranoid Android

Elite Member
Joined
Jun 20, 2010
Messages
2,864
Reaction score
4,209
Hey guys, I have an html antiquated site with an antiquated php contact form that was made for php4. And the mail() isn't working on php7. Has the format/syntax changed? Can I get it to work again, or is there some other code that I can use with php7 with the same variables from the form?
 
I don't think anything major has changed. Do you get any error? Could you show me the current call for mail function on the script?
 
I don't think anything major has changed. Do you get any error? Could you show me the current call for mail function on the script?
hey my man, just mail($to, $subject, $message, $header);

worked fine with php5.5, stopped when I upgraded to 7
 
hey my man, just mail($to, $subject, $message, $header);

worked fine with php5.5, stopped when I upgraded to 7
It's still the same in php 7, that's for sure. :)
Here's the documentation:
Code:
https://www.php.net/manual/en/function.mail.php

There are two possibilities.
1) mail() function is disabled in the particular server you are trying.
2) You are port blocked by the server admin.

Using a SMTP mailer (like phpmailer for example) is a much better and easier option, as it gives you much more options out of the box.

P.S. if you are getting any kind of error, please paste it here or PM me. I can take a look why this does not work. :)

Also, did you install Exim when you upgraded to php7? That could be the reason.
 
I don't get any errors, I get the popup alert on the page and get redirected to html. so like you say it could be a server thing. I'll talk to the host.

I'll check out the documentation for phpmailer too
 
Back
Top