Hi,
I want a step by step tutorial or guidance to send email in php.I am trying to send email in php using mail() but i am unable to send email.
I am using script like below :-
<?php
mail(“[email protected]”,”subject”,”message”);
?>

Bhaskar Bhatt Default Asked on February 5, 2016 in Programming.
Add Comment
  • 1 Answer(s)

    Hi,
    you are not able to send email in php because you are not sending headers along with email.
    Please try with below simple tutorial to send email in php.

    <?php
    $to      = '[email protected]';
    $subject = $subject ;
    $message = $message ;
    $header = "From: [email protected]\r\n"; 
    $header.= "MIME-Version: 1.0\r\n"; 
    $header.= "Content-Type: text/plain; charset=utf-8\r\n"; 
    $header.= "X-Priority: 1\r\n"; 
    
    mail($to, $subject, $message, $header);
    ?>
    Ravi Dobariya Default Answered on February 8, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.