Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('PHPMailerAutoload.php');
- $mail = new PHPMailer();
- //$mail->IsSMTP(); // telling the class to use SMTP
- // $mail->Host = "localhost"; // SMTP server
- //IsSMTP(); // send via SMTP
- $mail->Host = "ssl://smtp.gmail.com"; // SMTP server Gmail
- $mail->Mailer = "smtp";
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "email@gmail.com"; //
- $mail->Password = "password"; // SMTP password
- $webmaster_email = "username@domain.com"; //Reply to this email ID
- $email="harry.luanda@gmail.com"; // Recipients email ID
- $name="Harry"; // Recipient’s name
- $mail->From = $webmaster_email;
- $mail->FromName = "Webmaster";
- $mail->AddAddress($email,$name);
- $mail->AddReplyTo($webmaster_email,"Webmaster");
- $mail->WordWrap = 50; // set word wrap
- $mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
- $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
- $mail->IsHTML(true); // send as HTML
- $mail->Subject = "This is the subject";
- $mail->Body = "Hi,This is the HTML BODY "; //HTML Body
- $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- echo "Message has been sent";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement