Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('phpmailer/class.phpmailer.php');
- $mail = new PHPMailer;
- $mail->SMTPDebug = 1; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'test@test'; // SMTP username
- $mail->Password = 'test'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- $mail->setFrom('test@thecopyrat.com', 'Subject');
- $mail->addAddress('maulik153m@gmail.com');
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Test';
- $mail->Body = 'Demo';
- if(!$mail->send()) {
- return 'Message could not be sent.';
- return 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- return 'Message has been sent';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement