Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Settings to send an email from localhost for PHP code in Windows Vista

I am using PHP 5 and Apache to do some programming. My code can correctly send emails on the live server, but on my own development machine, I cannot send emails. There is obviously nothing wrong with my code (since it only fails to send the email on my development machine), so I guess the problem is with my settings.

I have turned off IIS so that I can assign port 80 to Apache. I did not install PHP, Apache, or MySQL by using WAMP or XAMPP - I installed each component individually. I have already tried assigning SMTP to localhost in php.ini and the port number, etc... Nothing works.

I am running on Windows Vista, and am using a router at home. I assign a fixed IP address ( to my development machine. I used PHPMailer where I state a specific from address and to address, and once again, I insist that the code works on my live server - it is just not working on my development machine.

I tried the two solutions given in the last time I asked this question over here: Settings to send an email from localhost for PHP code in Windows Vista

But it turns out the solution that I accepted had a limit of sending 10 emails a day, and for some reason, it was working intermittently. Also, the other solution required me to jump through too many hoops.

Is there a better solution?

share|improve this question

marked as duplicate by BinaryMisfit Feb 18 '10 at 1:18

This question was marked as an exact duplicate of an existing question.

Might want to put this on – D'Arvit Sep 19 '09 at 18:53
I'd switch back to Windows XP if I were you. Better yet, use linux. – Randell Sep 19 '09 at 19:55
Please do not post duplicate questions. Edit the original with more details to get more or better answers. – BinaryMisfit Feb 18 '10 at 1:19
detail blog: – Suresh Kamrushi Jun 22 '15 at 11:37

Try this one:

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:" . "\r\n";
mail("","test subject","test body",$headers);
share|improve this answer

Not the answer you're looking for? Browse other questions tagged .