Advertisement
Guest User

Untitled

a guest
May 16th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $mail = new PHPMailer(); // create a new object
  2. $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
  3. $mail->SMTPAuth = true; // authentication enabled
  4. $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
  5. $mail->Host = "smtp.gmail.com";
  6. $mail->Port = 465; // or 587
  7. $mail->IsHTML(true);
  8. $mail->Username = "paziuand@gmail.com";
  9. $mail->Password = "pazislaw1993";
  10. $mail->SetFrom("paziuand@gmail.com");
  11. $mail->Subject = "Test";
  12. $mail->Body = "hello";
  13. $mail->AddAttachment($_FILES['uploaded_file']['tmp_name'],$_FILES['uploaded_file']['name']);
  14. $mail->AddAddress("paziuand@gmail.com");
  15.  
  16. if(!$mail->Send()) {
  17. echo "Mailer Error: " . $mail->ErrorInfo;
  18. } else {
  19. echo "Message has been sent";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement