InMotion Hosting Support Center

PHP mail() not working

Category: Website

2013-04-23 1:21 pm EST

Hits: 1,293
A colleague asked me to upload a simple PHP script to my server for testing.

$to = $_REQUEST['to'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
mail($to, $subject, $message);

The script collects values from a form and works fine on his server but not on my inmotion server. Is there some global setting that would prevent this script?

You must login before you can ask a follow up question.

You must login before you can submit an answer.



5,889 Points
2013-04-23 2:13 pm EST
Thank you for your question gfoxapus!

I tested your script by removing the &_REQUEST's and filling in plain text variables. It appears the problem is with your form posting the info through teh browser. Below is an excerpt of what I used with the exception of the email address

$to = '';
$subject = 'Hello World!';
$message = 'Body of the email.';

mail($to, $subject, $message);

Check your Form if its posting the variables. Please see the following article for more information on setting up a <a href="">PHP email form</a>.

<a href="">How to create a custom PHP contact form </a>

<a href="">Using the PHP mail() Function to send emails from a form </a>

Best regards,
James R

You must login before you can post a comment about this answer.

I tried several things including removing the variables and then I checked my main email account associated with my inmotion account and found a slew of returned email:

Your access to this mail system has been rejected due to the sending MTA's
poor reputation. Please reference the following URL for more information: If you believe that
this failure is in error, please contact the intended recipient via alternate

I'm going to try something else for now. Thanks anyway.
8 Points
2013-04-23 3:25 pm EST
Hello Gfoxapus,

The current suggestion is to change the variable of the "from" email address to a local mail address . This will help prevent the issue you're trying to deal with (suggestion came from a systems person here). I also will submit a ticket in your name regarding the server reputation. Unfortunately, this is one of those issues where we're fighting spammers on server level and the best thing that can be done to clear the server reputation is to set the server to a new IP address.

You can find more information on PHPmail here:

Using phpMailer

I hope this hopes to resolve your problem! If you're still having issues with it, please let us know.

If you have any further questions, please contact technical support available 24 hours a day / 7 days a week.


Arnel C.
Community Support
40,963 Points
2013-04-23 3:51 pm EST
Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!