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 = '[email protected]'; // 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('[email protected]', 'CodexWorld');
- $mail->addReplyTo('[email protected]', 'CodexWorld');
- $mail->addAddress('[email protected]'); // 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