Q:

Mail() not working, any ideas why?

Hi guys i am using the mail() from the contact form and for some reason it is not working.
The php coding i have setup is as follows:
            // sending email to sales@xxx.com
        $to      = "hello@xxx.com";
        $subject = 'Email From {$name} from your website';
        $message = "$name has contacted you from the website and says:

        $mcontent

        $name 's contact email address is: $email"; 

        $headers = $email . "\r\n";
        $headers .= "Reply-To: " . $email . "\r\n"; 
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 

        mail($to, $subject, $message, $headers) or die ("Failure");
        // end of sending mail

        returnheader("/xxx/email-sent");  

i get no errors at all, it even goes to the success page when completed.
Any ideas why this would not work.

A:

I have checked your code and it is working fine on my server , i am getting e-mail.
Here , it looks like some problem with your SMTP server settings.
There is nothing wrong with your PHP script.
You can find your solution here.
php.ini & SMTP= - how do you pass username & password
Also in windows environment ,
http://www.ruhanirabin.com/php-sendmail-setup-with-smtp-iis-and-windows-servers/

