The PHP () Mail Function:
Sending Email messages is very common for a web application, for example: sending a welcome email when a user create a new account on your website, sending newsletters to your registered users, or getting user feedback or comment through the website's contact from and many more. You can use the PHP built-in
mail()
function for creating and sending email messages to one or more recipients dynamically from your PHP application either in a plain-text form or formatted HTML.Mail() function Basically used for :
mail(to, subject, message, headers, parameters)
To:
The Recipient's E-mail Adddress
Subject:
Your Message or Content and Pass the Parameter
Message:-
Your Message Sent Another User your message content separated with a line feed-LF (
\n
). Lines should not exceed 70 charactersHeaders:
This is typically used to add extra headers such as "From", "Cc", "Bcc". The additional headers should be separated with a carriage return plus a line feed-CRLF (
\r\n
).Parameters:
Used to pass additional parameters
For Examples Mail Send code in PHP:
$to='someone [email protected]';//Another one E-mail
$subject='Make My Webdesign';//for example:some one content write
$mesage='HI MAKEMYWebdesign';//someone commands
$from='[email protected]';your E-mail
/// Sending Mail condition
if(mail($to,$subject,$message)){
echo'mail send successfully';
}
//mail not sending error message through condition
else{
echo'mail not send please try again';
}
You Can Try Better Out Put
All the Best!!!!
This post first appeared on WebDesign | SEO Services Full Tutorial | PHP Full Tutorial | Javascript Full Tutorial|HTML,CSS,CMS, please read the originial post: here