Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer\PHPMailer;
- require 'autoload.php';
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->SMTPDebug = 2;
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 465;
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'ssl';
- $mail->Username = 'you@gmail.com';
- $mail->Password = 'Yourpassword';
- $mail->setFrom('you@gmail.com', '');
- $mail->addReplyTo('you@gmail.com', '');
- $mail->addAddress('recipient@gmail.com', '');
- $mail->Subject = 'This means that emails work fine.';
- $mail->msgHTML("<h1>Incoming message to Houston</h1>");
- if (!$mail->send()) {
- echo 'error: ' . $mail->ErrorInfo;
- } else {
- echo 'message sent';
- }
- //if (!$mail->send()) {
- // echo $message_error . $mail->ErrorInfo;
- //} else {
- // echo $message_send;
- //}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement