cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Mail() No Longer Working

virnuls
Dabbler
Posts: 21
Thanks: 2
Registered: ‎05-07-2010

PHP Mail() No Longer Working

I just had the idea of adding a reCAPTCA thing to my website, when I noticed that the contact form no longer works.

I've used the PHP mail() function on a couple of pages and it's worked for years. I know that it's worked as recently as VE Day because I made a quiz for our virtual street party and the neighbours' answers came to me.

The scripts look like they're working - there are no obvious errors - but the messages don't arrive. Has anyone else noticed a similar problem?

7 REPLIES 7
virnuls
Dabbler
Posts: 21
Thanks: 2
Registered: ‎05-07-2010

Re: PHP Mail() No Longer Working

There's been another change in behaviour - where the scripts used to run but not work, they now stop with an error 500.

virnuls
Dabbler
Posts: 21
Thanks: 2
Registered: ‎05-07-2010

Re: PHP Mail() No Longer Working

OK - after some investigation it appears that it's got more fussy about the content of the message and if I swap the text to something very simple the message arrives.

Time for some more research!

Alex
Community Veteran
Posts: 5,500
Thanks: 921
Fixes: 13
Registered: ‎05-04-2007

Re: PHP Mail() No Longer Working

Could it be the server being fussy and thinking you're sending out spam (or something like that) and blocking it?
I've only ever used PHP a bit, so that is a pure guess.

virnuls
Dabbler
Posts: 21
Thanks: 2
Registered: ‎05-07-2010

Re: PHP Mail() No Longer Working

Thanks, yes, I'm sure it's something like that. They've obviously tightened up the rules because I have three pages that send emails and they've all stopped working, but the lack of error messages from the script suggests that the message is being sent but getting stopped en-route.

I run another site for work and the host for that started to get upset if we sent a message to more than "about" ten people, which was a bit inconvenient as we're teachers and often want to email a whole class.

These messages are only going to one person, though (me), and they go if the message is fixed at "hello" but not if the text comes from a web form. The messages validate as HTML5, so it's not that.

There's not obviously any support for the "CGI" web space, so it might be a question for something like StackOverflow!
Alex
Community Veteran
Posts: 5,500
Thanks: 921
Fixes: 13
Registered: ‎05-04-2007

Re: PHP Mail() No Longer Working

I assume you are using PlusNet hosting?

So it might be better (a member of staff may pick this up) to give them some info on what you are doing? Don't give away more than you need to on here as it public.

It could well be the case they've tightened up on security their side, so what used to work does not anymore. May just be a case of trial and error on your part and see what works and what doesn't. Then finding something which does which you're happy with. 

virnuls
Dabbler
Posts: 21
Thanks: 2
Registered: ‎05-07-2010

Re: PHP Mail() No Longer Working

In case someone else is having a similar problem...

I've done some tinkering and two of the three scripts are now working.  Removing all e-mail addresses and URLs from the content of the message seemed to do the trick.

One of the pages was a contact form, and it used to say "Message sent from..." with a hyperlink to the page at the bottom.  It seems that that was the problem.

PS.  Yes - this is a page hosting the in the "CGI webspace".  They're obviously doing some work on that because https://hosting.plus.net now looks completely different, and a couple of days again it said that I had no MySQL database, but now it's appeared again.

Alex
Community Veteran
Posts: 5,500
Thanks: 921
Fixes: 13
Registered: ‎05-04-2007

Re: PHP Mail() No Longer Working

Yeah sounds like they are doing some work behind the scenes. Hopefully it will settle down after a while and it will be back to normal.