Blog Details

mail() Function


                                
                                    <h2>* PHP mail() Function :-</h2>
<ul>
	<li>
<h3><strong><span style="font-size: 13px;">The mail() function allows you to send emails directly from a script.</span></strong></h3>
</li>
</ul>
<h2><strong>Syntax :</strong></h2>
<strong>mail(<em>to,subject,message,headers,parameters</em>);</strong>
<h2><strong> </strong><em><strong>to  </strong>  :                          </em></h2>
<em>           Required. Specifies the receiver / receivers of the email</em>

<em><strong>subject  :</strong>       </em>

<em>             Required. Specifies the subject of the email. <b>Note:</b> This parameter cannot contain any newline characters</em>

<em><strong>message</strong>   :                  </em>

<em>                  Required. Defines the message to be sent. Each line should be separated with a LF (\n). Lines should not exceed 70                           characters.</em>

<b></b><em><strong>headers   :       </strong>           </em>

<em>                  Optional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF                    (\r\n).</em>

<em><strong>parameters   :</strong></em>

<em><strong>   </strong>                        Optional. Specifies an additional parameter to the sendmail program (the one defined in the sendmail_path                                           configuration setting).</em>
<h2><strong>Example :</strong></h2>
&lt;?php
$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);
?&gt;
                                    


Categories

Core_PHP

Latest posts

13.05.14
Implementing CRUD Operations ¶

<ul> <li>Now comes the fun part. We would like t

13.05.14
View

<ol> <li><a href="http://www.yiiframework.com/do

13.05.14
Creating Model

<ol> <li><a href="http://www.yiiframework.com/do

Get Free Quote