Tags
, ,
Asked 30+ days ago
25 Aug 2017
Views 241
jaggy

jaggy posted

how to send mail in PHP ?

how to send email in PHP ?

i am using smtp for making it faster delivery to my registered user

so its true that by SMTP mail is reached so fast. or normal mail function is good
Phpworker

Phpworker
answered Jan 21 '18 20:17

mail function is used to send Email in PHP


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


mail function have following argument
1. $to , email address where mail sent to
2. $subject , email subject
3. $message , email message body
4. $header , mail header (optional)

$headers = 'From: support@example.com' . "\r\n" .
'Reply-To: support@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$subject="Contact Us from eXample.com  ";
$message="Name ::  ".$_REQUEST['name']." \n";
$message.="Email :: ".$_REQUEST['email']." \n";
 $message.="Message :: ".$_REQUEST['message']."\n";
$admin_email="dilip.bakotiya@gmail.com";
 
if(mail($admin_email,$subject,$message,$headers)){
	$mailsent=1; 
}
Edit Answer
Share
Post Answer