mysql_connect( ) function is used for MySQL connection and mysql_select_db( ) is used to select database.
Connection to MySQL server in PHP & Database Selection
mysql_connect( ) function is used for MySQL connection and mysql_select_db( ) is used to select database.
mail( ) function in PHP
Email can be send using PHP by using mail( ) function.
Syntax of mail function is
mail (to,subject,message,headers)
| Parameter | usage |
|---|---|
| to | reciever email |
| subject | Subject of Email |
| message | Content to be sent in message |
| headers | Optional. It is used for additional headers, like From, Cc, and Bcc. |
Now let write the code for sending email.
<?php
$subject = "Email";
$message = "This is Test email ";
$to = "test@gmail.com";
$from = "aa@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
?>
Subscribe to:
Comments (Atom)