Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1.     function odesliMail($prijemce){
  2.         $mail  = new PHPMailer();
  3.         $mail->IsSMTP();
  4.          
  5.         //GMAIL config
  6.             $mail->SMTPAuth   = true;                  // enable SMTP authentication
  7.             $mail->SMTPSecure = "ssl";                 // sets the prefix to the server
  8.             $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  9.             $mail->Port       = /*465*/25;                   // set the SMTP port for the GMAIL server
  10.             $mail->Username   = "jankslavik@gmail.com";  // GMAIL username
  11.             $mail->Password   = "***";            // GMAIL password
  12.         //End Gmail
  13.          
  14.         $mail->From       = "jankslavik@gmail.com";
  15.         $mail->FromName   = "H4NS";
  16.         $mail->Subject    = "test";
  17.         $mail->Body       ="Zdar";
  18.          
  19.             //$mail->AddReplyTo("reply@email.com","reply name");//they answer here, optional
  20.         $mail->AddAddress("cassano.re@seznam.cz","name to");
  21.         $mail->IsHTML(false); // send as HTML
  22.          
  23.         if(!$mail->Send()) {//to see if we return a message or a value bolean
  24.           //echo "Mailer Error: " . $mail->ErrorInfo;
  25.         } //else  echo "Message sent!";
  26.                
  27.         return true;
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement