Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Agência Mocho</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" href="../images/favicon.gif" />
- <style type="text/css">
- a:link {
- text-decoration: none;
- color: #f24f13;
- }
- a:visited {
- text-decoration: none;
- color: #f24f13;
- }
- a:hover {
- text-decoration: underline;
- color: #f24f13;
- }
- a:active {
- text-decoration: none;
- color: #f24f13;
- }
- body {
- background-color: #333333;
- font-family:Arial, Helvetica, sans-serif;
- color:#c0c0c0;
- }
- body,td,th {
- color: #c0c0c0;
- }
- a {
- font-size: 12px;
- }
- </style>
- <!--Google Analytics-->
- <script type="text/javascript">
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-48343930-1', 'agenciamocho.com');
- ga('send', 'pageview');
- </script>
- </head>
- <body>
- <br /><br /><br />
- <table align="center" width="100%" border="0">
- <tr><td align="center">
- <br />
- <img src="../images/agencia-mocho-envio.png" alt="" height="115" width="240" align="middle" />
- <br /><br />
- <?php
- /*apenas dispara o envio da mensagem caso houver/existir $_POST['enviar']*/
- if (isset($_POST['enviar']))
- {
- $destinatarios = 'nome@email.com';
- $nomeDestinatario = 'Agencia Mocho';
- $usuario = 'nome@email.com';
- $senha = 'XXXXXX';
- /*abaixo as veriaveis principais, que devem conter em seu formulario*/
- $categoria = $_POST["categoria"];
- $nome = $_POST["nome"];
- $email = $_POST["email"];
- $cidade = $_POST["cidade"];
- $website = $_POST["website"];
- $empresa = $_POST["empresa"];
- $areaatuacao = $_POST["areaatuacao"];
- $tipodenegocio = $_POST["tipodenegocio"];
- $caracterconteudo = $_POST["caracterconteudo"];
- $incluir_objeto_na_marca = $_POST["incluir_objeto_na_marca"];
- $preferencia_cores = $_POST["preferencia_cores"];
- $referencia = $_POST["referencia"];
- $comentarios = $_POST["comentarios"];
- //Loop para o Checkbox $caracterconteudo
- if (isset($_POST["enviar"])){
- foreach($_POST["caracterconteudo"] as $caracterconteudo)
- {$caracterconteudo_check = "$caracterconteudo_check "."$caracterconteudo".",";
- }}
- //Dados que vão aparecer no corpo do e-mail
- $_POST['mensagem'] = nl2br('
- <b>Nome:</b> '. $_POST['nome'] ."
- <b>E-mail:</b> ". $_POST['email'] ."
- <b>Cidade:</b> ". $_POST['cidade'] ."
- <b>Website:</b> ". $_POST['website'] ."
- <b>Nome que aparecerá no Logotipo:</b> ". $_POST['empresa'] ."
- <b>Descreva a sua área de atuação:</b> ". $_POST['areaatuacao'] ."
- <b>O seu negócio é um(a):</b> ". $_POST['tipodenegocio'] ."
- <b>Quais características descrevem melhor o seu negócio?</b> $caracterconteudo_check"."
- <b>O que não pode faltar na sua marca?</b> ". $_POST['incluir_objeto_na_marca'] ."
- <b>Cores de sua preferência:</b> ". $_POST['preferencia_cores'] ."
- <b>Possui referência de outra marca?:</b> ". $_POST['referencia'] ."
- <b>Comentarios Finais:</b> ". $_POST['comentarios']);
- //mensagens de erro para caso algum campo fique em branco
- if ($nome == "") {
- echo "<p align=center>Por favor, preencha o campo nome.</p>";
- }
- else if ($email == "") {
- echo "<p align=center>Por favor, preencha o campo email.</p>";
- }
- else if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
- echo "<p align=center>Informe um e-mail válido.</p>";
- }
- else if ($empresa == "") {
- echo "<p align=center>Por favor, preencha o campo empresa.</p>";
- }
- else {
- /*********************************** A PARTIR DAQUI NAO ALTERAR ************************************/
- include_once("../phpmailer/class.phpmailer.php");
- $To = $destinatarios;
- $Subject = 'Orcamento - Logotipo';
- $Message = $_POST['mensagem'];
- $Host = 'smtp.'.substr(strstr($usuario, '@'), 1);
- $Username = $usuario;
- $Password = $senha;
- $Port = "587";
- $mail = new PHPMailer();
- $mail->IsSMTP(); // telling the class to use SMTP
- $mail->Host = $Host; // SMTP server
- $mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
- // 1 = errors and messages
- // 2 = messages only
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->Port = $Port; // set the SMTP port for the service server
- $mail->Username = $Username; // account username
- $mail->Password = $Password; // account password
- $mail->SetFrom($usuario, $nomeDestinatario);
- $mail->Subject = $Subject;
- $mail->MsgHTML($Message);
- $mail->AddAddress($To, "");
- // CÓDIGO DO ANEXO - SIMPLES!
- $files = $_FILES['files'];
- for ($i=0; $i < sizeof($files); $i++)
- {
- if (is_uploaded_file($files['tmp_name'][$i]))
- {
- // Adiciona um anexo de um caminho sobre o sistema de ficheiros
- $mail->AddAttachment($files['tmp_name'][$i], $files['name'][$i]);
- }
- }
- // FIM DO CÓDIGO DO ANEXO
- if(!$mail->Send()) {
- $mensagemRetorno = 'Erro ao enviar e-mail: '. print($mail->ErrorInfo);
- $mail->ErrorInfo."\n";
- } else {
- echo "<p align=center>$nome, sua mensagem foi enviada.</p>";
- echo "<p align=center>Retornaremos em breve.</p>";
- }
- }
- }
- ?>
- <br /><br />
- <a href="../orcamento-logotipo.html"> retornar </a>
- </td></tr></table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement