How to use E-mail in PHP

In this article I will go to explain about PHP E-mails.
  • 1850

PHP E-mails

E-mail is the most popular internet service today. PHP E-mails also provide mail transferring facility.

Syntax of  PHP E-mail

mail(to,subject,message,headers,parameters);

Parameters in PHP E-mail

There are following parameters in PHP E-mail:

Parameter Description
to Here write receiver Email.
subject Write the subject of the email.
message Here write that message who want to send.
headers It is optional, Here specifies additional header like cc,bcc.
parameters It is optional.

Example of  E-mail

<html>

<body>

<?php

$to = "abc@example.com";

$subject = "Write Subject related information here";

$message = "Here write simple email message.";

$from = "xyz@example.com";

$headers = "From:" . $from;

mail($to,$subject,$message,$headers);

echo "Your mail has been sent";

?>

</html>

</body>


You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.