The php mail() is used to send emails. It normally takes five parameters, among these three parameters are required. The five parameters are as follows
- to (Required. Specify the email address of reciever)
- subject (Required. Specify the subject of the email)
- message(Required. Specify the message of the email)
- headers(Optional. Specify the other additional information like from.cc, bcc etc
- parameters(Specify additional parameter)
PHP Simple Email Program
The simplest way for email to be send is a text based email
$to="abc@yahoo.com";
$subject="Testing email in php";
$message="I just want to test the email functionality in php";
$from="xyz@gmail.com";
$headers="from:$from";
mail($to,$subject,$message,$headers);
echo "Email sent successfully";
0 comments:
Post a Comment