12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
-
- require_once ('PHPMailer_5.2.0/class.phpmailer.php');
-
-
- $name = $_POST['name'];
- $email = $_POST['email'];
- $subject = $_POST['subject'];
- $message = $_POST["message"];
-
- // $resume = $_POST["resume"];
-
- // $resume_file = $_FILES["resume-file"];
- // $resume_name = $resume_file['name'];
- // ob_start(); ?>
- <html>
- <head>
- <title>Apply</title>
- </head>
- <body>
- <table>
- <tr>
- <td>Name:</td>
- <td><?php echo $name; ?></td>
- </tr>
- <tr>
- <td>Email:</td>
- <td><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></td>
- </tr>
-
- <tr>
- <td>Message:</td>
- <td><?php echo $message; ?></td>
- </tr>
-
- </table>
- </body>
- </html>
- <?php
-
- $msg = ob_get_clean();
-
-
- $mail = new PHPMailer();
- $mail->IsSMTP(); // telling the class to use SMTP
-
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "tls"; // enable SMTP authentication
- $mail->Host = "mail.dilig.net";
- $mail->Port = 587;
- $mail->Username = "[email protected]"; // SMTP username
- $mail->Password = "contactus#dlgnt"; // SMTP password
- $mail->SetFrom($email, $name);
-
-
- $mail->Subject = $subject;
-
- $mail->Body = $msg;
-
- $mail->AddAddress('[email protected]', "HR Diligent");
- $mail->IsHtml(true);
-
- $mail->send();
-
-
- echo json_encode("succesfull");
- ?>
|