SMTPDebug = SMTP::DEBUG_OFF; $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; // Your SMTP server $mail->SMTPAuth = true; $mail->Username = 'bi@gmail.com'; $mail->Password = 'A'; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; // Recipients $mail->setFrom($from_email, $from_name); $mail->addAddress($to); $mail->addReplyTo($from_email, $from_name); // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $message; $mail->AltBody = strip_tags($message); $mail->send(); return true; } catch (Exception $e) { return false; } } ?>