Send Mail using XAMPP Server with PHP


 


Hello readers, Today in this blog you'll learn how to Send Emails with PHP & Gmail | Send Mail from Localhost using XAMPP Server. Earlier I have shared a blog on How to configure XAMPP to send Mail from Localhost in PHP? If you haven't still read that blog, I want to suggest you read that blog first.

Generally, in this program, on the webpage, there is a mail send form with three inputs - email address, subject, and message. When you click on the send button without filling the form completely, there is display an alert labeled as  "All input fields are required!". And when you filled up all inputs and click on the send button, your mail will be sent to a particular email address that you've provided in the recipient field and there is also display a success message labeled as "Your mail sent successfully to someone email".

If somehow mail can't be sent, there is display an alert labeled as "Sorry, failed while sending mail!".

CSS Code /* custom css styling */ @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap'); html,body{ background: #007bff; } ::selection{ color: #fff; background: #007bff; } .container{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: 'Poppins', sans-serif; } .container .mail-form{ background: #fff; padding: 25px 35px; border-radius: 5px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); } .container form .form-control{ height: 43px; font-size: 15px; } .container .mail-form form .form-group .button{ font-size: 17px!important; } .container form .textarea{ height: 100px; resize: none; } .container .mail-form h2{ font-size: 30px; font-weight: 600; } .container .mail-form p{ font-size: 14px; }
PHP Code

Post a Comment

Previous Post Next Post