Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. if(!empty($_POST)){
  2. foreach($_POST['ck'] as $ck){
  3. $msg = "<img src="http://www.site.com.br/images/$ck"width="100px" height="70px"><br>";
  4.  
  5. // manda e-mail usuario
  6. $mail = new PHPMailer();
  7. $mail-> IsSMTP();
  8. $mail->CharSet = "UTF-8";
  9. $mail->SMTPAuth = true;
  10. $mail->SMTPSecure = 'tls';
  11. $mail->Port = 587;
  12. $mail->Host = "smtp.zoho.com";
  13. $mail->Username = "usuario@exemplo.com";
  14. $mail->Password = "senha";
  15. $mail->SetFrom("usuario@exemplo.com", "usuario");
  16.  
  17. $mail->AddAddress("recebedor@exemplo.com", "usuario");
  18. $mail->Subject = "assunto";
  19. $mail->msgHTML($msg);
  20.  
  21. if($mail->send()){
  22. echo "enviado com sucesso";
  23. exit();
  24. }else{
  25. echo "Erro ao enviar o email".$mail->ErrorInfo;
  26. }
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement