PHP Programing language

Sending Emails in PHP
Previous Home Next

Sending Emails in Php

Sending Emails in Php is used to send emails directly from a script. This is done by using the mail() function in php which allows you to send emails.


In the above syntax, "to" specifies the receiver / receivers of the email, "subject" specifies the subject of the email, "message" defines the message to be sent, "headers" specifies additional headers, like From, Cc, and Bcc and "parameters" specifies an additional parameter to the sendmail program.


   $to = "";
   $subject = "-------Subject-------";
   $message = "-------Message-------";
   $header = " \r\n";
   $retval = mail ($to,$subject,$message,$header);
   if( $retval == true )  
      echo "Message sent Successfully......!!!!";
      echo "Message could not be sent...!!!!!";


Message sent Successfully......!!!!
Previous Home Next