Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/PHPMailer.php");
- require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/SMTP.php");
- require("C:/xampp/htdocs/api/vendor/phpmailer/phpmailer/src/Exception.php");
- $mail = new PHPMailer\PHPMailer\PHPMailer(); // Passing `true` enables exceptions
- try {
- //Server settings
- $mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'mail.privateemail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'support@hypnos.network'; // SMTP username
- $mail->Password = 'support321!mail'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- //Recipients
- $mail->setFrom('support@hypnos.network');
- $mail->addAddress('akshaycm@hotmail.com'); // Name is optional
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Hypnos ICO Email Verification';
- $mail->Body = 'Thank you for registering for our ICO,please click this link to verify your account';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->send();
- echo 'Message has been sent';
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement