First let's create html form in mail.php file using bootstrap 4.5. before strats let's how it will looks like
Now let's create mail.php file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Mail</title>
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<!-- ckeditor -->
<script src="https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script>
</head>
<body>
<div class="jumbotron container-fluid py-3 bg-info text-white">
<div class="container ">
<h1>HTML Email sending using php</h1>
</div>
</div>
<?php if(isset($_REQUEST['msg'])){ ?>
<div class="alert alert-success" role="alert">
<?php echo $_REQUEST['msg']; ?>
</div>
<?php } ?>
<div class="container">
<form method="post" action="send_mail.inc.php">
<div class="form-group row">
<label class="col-sm-2 col-form-label">To:</label>
<div class="col-sm-10"><input type="email" name="emailid" class="form-control" value=""></div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Subject:</label>
<div class="col-sm-10"><input type="text" name="subject" class="form-control" value=""></div>
</div>
<div class="mail-text h-200">
<textarea rows="10" name="message" class="form-control" cols="100"></textarea>
<script>
CKEDITOR.replace( 'message' );
</script>
<div class="clearfix"></div>
</div>
<div class="mail-body text-right tooltip-demo mt-2">
<input type="submit" class="btn btn-success" name="send" value="send">
</div>
</form>
</div>
</body>
</html>
No comments:
Post a Comment
your suggestion are welcome by me