Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post" class="enquiryForm" id="input-form" action="post-enquiry.php">
- <input type="text" name="Name" placeholder="Name*" required=required>
- <input type="mobile" name="Mobile" placeholder="Contact No*" required=required>
- <textarea rows="5" placeholder="Requirement*" name="Requirement"></textarea>
- <input type=submit value="Submit" name="submit" class=frmSubmit />
- </form>
- My PHP post data:
- <?php if(isset($_POST['submit'])){
- //error_reporting(0);
- include("./mailer/class.phpmailer.php");
- $name = $_POST['Name'];
- $mobile = $_POST['Mobile'];
- $Requirement = $_POST['Requirement'];
- $mail = new PHPMailer;
- $mail->IsSMTP(); // enable SMTP
- $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
- $mail->SMTPAuth = true; // authentication enabled
- $mail->Host = '';/*Specify main and backup SMTP servers*/
- $mail->SMTPSecure = 'ssl';
- $mail->Port = '465';
- $mail->SMTPAuth = 'true';/*Enable SMTP authentication*/
- $mail->Username = '';/*SMTP username*/
- $mail->Password = '';/*SMTP password*/
- $mail->setFrom($email, $name);
- $mail->addAddress('rajkumar@gmail.com' , 'rajkumar');
- $mail->isHTML(true);
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail->AltBody = $subject;
- $mail->send();
- if(!$mail->send()) {
- ?>
- <script type="text/javascript">
- window.alert("Something went wrong, your mail not sent sucssfully!");
- </script>
- <?php
- }
- else{
- header("location:thanks.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement