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->IsSMTP(); // send via SMTP
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = ”yourusername@gmail.com“; // Enter your SMTP username
- $mail->Password = ”yourpassword“; // SMTP password
- $webmaster_email = ”yourusername@yourdoamin.com“; //Add reply-to email address
- $email=”yourusername@domain.com“; // Add recipients email address
- $name=”name“; // Add Your Recipient’s name
- $mail->From = $webmaster_email;
- $mail->FromName = ”Webmaster”;
- $mail->AddAddress($email,$name);
- $mail->AddReplyTo($webmaster_email,”Webmaster”);
- $mail->WordWrap = <strong>50</strong>; // 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 your subject“;
- $mail->Body = ”Hi, this is your email body, etc, etc” ; //HTML Body
- $mail->AltBody = ”Hi, this is your email body, etc, etc“; //Plain 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