How to send mail using PHP?

Posted by phpaddict on Stack Overflow See other posts from Stack Overflow or by phpaddict
Published on 2009-03-11T10:47:13Z Indexed on 2010/05/06 10:08 UTC
Read the original article Hit count: 143

Filed under:
|

I'm using Windows Vista OS. PHP, MySQL as the database and Apache web server.

I want to send notification to those who want to join in my site. But the problem is when I click submit. It doesn't send anything to the email address of the user.

What to do you think is the best solution for this?

<?php
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about email