Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'GMAIL EMAIL ACCOUNT';
- $mail->Password = 'MY PASSWORD FOR GMAIL EMAIL ACCOUNT';
- $mail->SMTPSecure = 'tlc';
- $mail->Port = 587;
- $mail->SMTPDebug = 3;
- $mail->setFrom('EMAIL ADDRESS', 'EXAMPLE');
- $mail->addAddress('ADDRESS TO SEND', 'From contact form');
- $mail->addCC('cc@example.com');
- $mail->addBCC('bcc@example.com');
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'This is the HTML message body <b>in bold!</b>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
Add Comment
Please, Sign In to add comment