Advertisement
Guest User

Untitled

a guest
Sep 5th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <form method="post" action="script/trab_send.php" id="form_trab" onsubmit="return validar(this)" autocomplete="off" enctype="multipart/form-data">
  2. <input type="text" class="box" placeholder="NOME*" id="nome" name="nome" pattern="[A-Za-zÀ-úÂ-ûÃ-õ]+$" required>
  3. <input type="email" class="box" placeholder="E-MAIL*" name="email" required>
  4. <input type="tel" class="box" placeholder="TELEFONE*" name="fone" required pattern="([0-9]{2}) [0-9]{4}-[0-9]{4,5}$" OnKeyPress="mascara(this)" maxlength="15">
  5. <input id="fakeupload" name="fakeupload" class="fakeupload" type="text" placeholder="ANEXAR ARQUIVO" />
  6. <input id="realupload" name="realupload" class="realupload" type="file" progress onchange="this.form.fakeupload.value = this.value;" />
  7. <input type="submit" value="Enviar" class="btn-ajuda">
  8. </div>
  9. </form>
  10. <div class="resposta"></div> `=$_FILES['realupload'];
  11.  
  12. $mail = new PHPMailer();
  13.  
  14. $mail->IsSMTP();
  15. $mail->SMTPAuth = true;
  16. $mail->SMTPDebug = 0;
  17. $mail->Port = 587;
  18. $mail->CharSet = 'UTF-8';
  19. $mail->Host = '';
  20. $mail->Username = '';
  21. $mail->Password = '';
  22. $mail->SetFrom('');
  23. $mail->AddAddress('');
  24. $mail->Subject = '';
  25. $mail->IsHTML(true);
  26. $mail->Body=$body;
  27. $body = "<strong>Arquivo: </strong>{$arquivo['name']}";
  28.  
  29. $mail->MsgHTML($body);
  30. $mail->AddAttachment($arquivo['tmp_name'], $arquivo['name']);
  31.  
  32.  
  33.  
  34. if($mail->Send()){
  35. echo "<div class='sucesso'>Formulário enviado com sucesso! Em breve entraremos em contato!</div>";
  36.  
  37. $(document).ready(function(){
  38. $(".resposta").hide();
  39. $("#form_trab").ajaxForm({
  40. target: '.resposta',
  41. success: function(retorno){
  42. $(".resposta").html(retorno);
  43. $(".resposta").show();
  44. }
  45. });`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement