SMTP Server Email | Static HTML Page E-mail Sender PHP Using Gmail SMTP

SMTP Server Email Static HTML Page E-mail Sender PHP Using Gmail SMTP

Static HTML Page E-mail Sender PHP Using Gmail SMTP

How we can send an email utilizing Gmail SMTP server from a PHP page/script.
 SMTP is a shortened form of Simple Mail Transfer Protocol.
 SMTP is a web standard for electronic mail, i.e., email.
 All mail servers and other mail exchange specialists utilize SMTP to send and get emails.
 Firstly, we’ll investigate the PHP mailer library we’re going to use.
 You can take this library as a contrasting option to mail() work in PHP.
After that, we’ll talk about the procedure.

Some portion of what makes the PHP mail() function is so straightforward is its absence of adaptability. It’s baffling that stock PHP mail() does not ordinarily enable you to utilize the SMTP server of your decision, and it doesn’t support SMTP authentication —required by many mail servers.

Live Demo   Download Source Code


<form method="post" id="contact-formc" class="form" role="form" novalidate="novalidate">
   <div class="form-group">    
      <input type="text" class="form-control" name="fcname" placeholder="Full Name *" required>
   <div class="form-group">    
      <input type="text" class="form-control" name="fcemail" placeholder="Email *" required>
   <div class="form-group">    
      <input type="text" class="form-control" name="fcwebsite" placeholder="Website" required>
   <div class="form-group">
      <textarea rows="5" class="form-control" name="fccomment" placeholder="Your Message *" style="height:175px;" required></textarea>
   <div id='message_post'></div>
   <input class="submit-detailss btn btn-default form-send" type='button' value='SUBMIT' name='submitf' id="submitf">
   <p class="success-messages" style="color: #149214; display:none;" ><i class="fa fa-check-circle contact-done-icon"></i> Sent Successfuly...</p>
   <p class="unsuccess-messages" style="color: #F00; display:none;" ><i class="fa fa-times-circle contact-done-icon"></i> Sending failed...</p>


$to_address = "";
$subject = "Customer Requirement";

$message = 'Full Name:'.$_POST['fcname'].'<br/> Email:'.$_POST['fcemail'].'<br/> Website:'.$_POST['fcwebsite'].'<br/> Message :'.$_POST['fccomment'].'<br/>';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8 " . "\r\n";

// More headers
$headers .= "Reply-To: Lisenme <> \r\n";
$headers .= "Return-Path: Lisenme <> \r\n";
$headers .= "From: Lisenme <> \r\n";
$headers .= "Organization: Lisenme \r\n";
$headers .= "X-Sender: Lisenme <>  \r\n";
$headers .= "X-Mailer: PHP \r\n";

    echo "1";
    echo "not done";


               $(document).on('click', '.submit-detailss', function(ev){
            if($("#contact-formc").valid() == true){
               var form_data = $("#contact-formc").serialize();
                $.post('fsend_mail_con.php', form_data , function(data,status){
                    if(data == 1){



You May Also Like

About the Author: Ranjith Kumar A

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x