stavros-s
5/16/2013 - 3:07 PM

Sending e-mail using PHP

Sending e-mail using PHP

<html>


  <head>

    <title>

      Sending email using PHP
    
    </title>

  </head>

  <body>

    <?php

       $to = "xyz@somedomain.com";
   
       $subject = "This is subject";
   
       $message = "This is simple text message.";
   
       $header = "From:abc@somedomain.com \r\n";
  
       $retval = mail ($to,$subject,$message,$header);

        if( $retval == true )  
        {

          echo "Message sent successfully...";

        }
        else
        {
      
          echo "Message could not be sent...";
   
        }

    ?>

  </body>

</html>