Advertisement
Guest User

Untitled

a guest
Sep 7th, 2016
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function sendmail ($email, $body){
  2. $mail = new PHPMailer;
  3. $mail->Host = 'relay-hosting.secureserver.net;smtp1.live.com;smtp2.hotmail.com;smtp2.outlook.com;smtp2.@outlook.my;smtp3.gmail.com;smtpout.secureserver.net'; // Specify main and backup SMTP servers
  4. $mail->SMTPAuth = true;
  5. $mail->Username = 'mypersonal email account, from gmail';
  6. $mail->Password = 'email password';
  7. $mail->SMTPSecure = 'tls';
  8. $mail->Port = 25;
  9. $mail->isHTML(true);
  10.  
  11. $mail->setFrom('my email', 'xxx');
  12. $mail->addAddress($email);
  13. $mail->Subject = 'From: xxx';
  14. $mail->Body = utf8_encode($body);
  15. $mail->AltBody = '';
  16. if(!$mail->send()) {
  17. return 'Mailer Error: ' . $mail->ErrorInfo;
  18. } else {
  19. return 'success';
  20. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement