Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', '1');
- require_once 'phpmailer/PHPMailerAutoload.php';
- $mail = new PHPMailer();
- try {
- //Server settings
- $mail->isSMTP(true); // Set mailer to use SMTP
- $mail->SMTPAuth = true;
- $mail->SMPTSecure = 'tls';
- $mail->Host ='smtp.gmail.com';
- $mail->Port='587';
- $mail->Username = 'mrl0c4d@gmail.com'; // SMTP username
- $mail->Password = 'KodokLoncat123'; // SMTP password
- //Recipients
- $mail->setFrom('', 'Perpustakaan SMK Telekomunikasi Telesandi Bekasi');
- $mail->addAddress('gooneps@gmail.com', 'bhh'); // Add a recipient
- $mail->addReplyTo('gooneps@gmail.com', 'Information');
- //Attachments
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'helo';
- $mail->Body = 'world';
- $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