Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter code here
- [![<body>
- <form name="FromID" method="post"><br>
- <br>
- <div align="center" style="font-family:Times New Roman; font-size:25px;font-weight:bold; ">COMPLAINTS ASSIGNED</div>
- <br>
- <br>
- <table border="1%" cellpadding="0" cellspacing="0" align="center" style="width:30%">
- <tr>
- <td colspan="2" width="5"><b>Staff Members</b></td>
- <td>
- <select id="staff" name="staff">
- <option value="s1">Athiyamaan</option>
- <option value="s2">Pazhanivel</option>
- <option value="s3">Sampath</option>
- <option value="s4">Sundharamoorthy</option>
- <option value="s5">Karthik</option>
- <option value="s6">Prabaharan</option>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="2" width="5"><b>E-mail</b></td>
- <td><input type="email" id="email" name="email" size="19" placeholder="joh@gmail.com" required>
- </td></tr>
- <tr>
- <td colspan="2" width="5"><b>Remarks</b></td>
- <td><textarea id="msg" rows="6" name="message" cols="20" placeholder="enter text here" required></textarea></td>
- </tr>
- <tr><td colspan="4" align="center">
- <input type='submit' value='submit' name="submit"></td>
- </tr>
- <?php
- if(isset($_POST['submit'])) {
- $errors = '';
- $myemail = 'rizwanamtech93@gmail.com';//<-----Put Your email address here.
- if(empty($_POST['staff']) ||
- empty($_POST['email']) ||
- empty($_POST['message']))
- {
- $errors .= "n Error: all fields are required";
- }
- $name = $_POST['staff'];
- $email_address = $_POST['email'];
- $message = $_POST['message'];
- //$body = "From: $namen E-Mail: $email_addressn Message:n $message";
- if (!preg_match(
- "/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/i",
- $email_address))
- {
- $errors .= "n Error: Invalid email address";
- }
- if( empty($errors))
- {
- $to = $myemail;
- $email_subject = "form submission: $name";
- $email_body = "You have received a new message. ".
- " Here are the details:n Name: $name n Email: $email_address n Message n $message";
- $headers = "From: $myemailn";
- $headers .= "Reply-To: $email_address";
- mail($to,$email_subject,$email_body,$headers);
- }
- }
- ?>
- <?php
- require 'PHPMailer-master/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'rizwanamtech93@gmail.com'; // SMTP username
- $mail->Password = 'subanallah'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom('from@example.com', 'Mailer');
- $mail->addAddress('rizwanamtech93@gmail.com', 'test User'); // Add a recipient
- //$mail->addAddress('ellen@example.com'); // Name is optional
- $mail->addReplyTo('rizwanamtech9316@gmail.com', 'Information');
- //$mail->addCC('cc@example.com');
- //$mail->addBCC('bcc@example.com');
- //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Remarks statement';
- $mail->Body = "You have received a new message.";
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- ?>
- </table><br><br>
- </form>
- </body>][1]][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement