Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailer-master/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'ssl://imap.gmail.com'; // Specify main and backup server
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'miko.dewaweb@gmail.com'; // SMTP username
- $mail->Password = '*****'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- $mail->Port = 587; //Set the SMTP port number - 587 for authenticated TLS
- $mail->setFrom('miko.dewaweb@gmail.com', 'miko'); //Set who the message is to be sent from
- $mail->addReplyTo('andry.jatmiko@dewaweb.com', 'First Last'); //Set an alternative reply-to address
- $mail->addAddress('andry.jatmiko@dewaweb.com', 'miko'); // Add a recipient
- $mail->addAddress('andry.jatmiko@dewaweb.com'); // Name is optional
- $mail->addCC('miko.dewaweb@gmail.com');
- $mail->addBCC('miko.dewaweb@gmail.com');
- $mail->WordWrap = 50; // Set word wrap to 50 characters
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'Hello, this is my message.';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement