How to send Mail Using PHP

1526 0

In this tutorial i will explain how to send mail using PHP mail function.The mail() function allows you to send emails directly from a script.

       

PHP Mail Function 
mail(to,subject,message,headers,parameters);

 

Parameters Description
to Required. Specifies the receiver / receivers of the email
subject Required. Specifies the subject of the email. Note: This parameter cannot contain any newline characters
message Required. Defines the message to be sent. Each line should be separated with a LF (n)not more than 70 characters.
headers Optional. Specifies additional headers like From Ccand Bcc.
parameters Optional. Specifies an additional parameter to the sendmail program (the one defined in the sendmail_path configuration setting).

First create a html form with three fileds

  • Email
  • Subject
  • Message

Index.php

PHP CODE put this code top on the index.php page

       

 

In this article

Join the Conversation


Share