Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer;
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'xx@gmail.com'; // SMTP username
- $mail->Password = 'xxxx'; // SMTP password
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPSecure = 'ssl';
- $mail->Port = 465;
- //Set the encryption system to use - ssl (deprecated) or tls
- $mail->setFrom('info@example.com', 'CodexWorld');
- $mail->addReplyTo('info@example.com', 'CodexWorld');
- $mail->addAddress('john@gmail.com'); // Add a recipient
- $mail->addAddress($data['email']); // Add a recipient
- $mail->isHTML(true); // Set email format to HTML
- $message = '
- <p>HELLO</p>
- ';
- $mail->msgHTML($message);
- try {
- if(!$mail->send())
- {
- echo $mail->ErrorInfo;
- } else {
- /*redirect*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement