Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $from = array(
- 'name' => 'From Name',
- 'email' => 'from@gmail.com',
- 'password' => 'password'
- );
- $to = array(
- 'name' => 'To name',
- 'email' => 'to@email.com'
- );
- $mail = new PHPMailer;
- $mail->isHTML(true);
- $mail->isSMTP();
- $mail->SMTPDebug = 0;
- $mail->Host = 'tls://smtp.gmail.com:587';
- $mail->SMTPAuth = true;
- $mail->Username = $from['email'];
- $mail->Password = $from['password'];
- $mail->setFrom($from['email'], $from['name']);
- $mail->addReplyTo($from['email'], $from['name']);
- $mail->addAddress($to['email'], $to['name']);
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement