Created
April 18, 2017 12:58
-
-
Save samuelsonbrito/7d7320e8fc7a237fe9485f0a9e254ce8 to your computer and use it in GitHub Desktop.
Gamb Mail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post = filter_input_array(INPUT_POST, FILTER_DEFAULT); | |
if (isset($post)): | |
$post = array_map('strip_tags', $post); | |
include_once './libs/PHPMailerN/PHPMailerAutoload.php'; | |
$font_texto = "<font face='Arial' size='2'>"; | |
$ffont = "</font>"; | |
$usuario = "MARCELO"; | |
$id = 1; | |
$id_tipo = 1; | |
$relato = "XXXXX"; | |
$url = "XXXXX"; | |
$mensagem = 'Mensagem enviada com sucesso!'; | |
$msg = "Cliente: {$post['nome']}<br/>"; | |
$msg .= "Mensagem: {$post['mensagem']}<br/>"; | |
$msg .= "<font color='#B0B0B0'>MRM Sistemas - Soluções em TI<br/>Portal MRM: http://mrmsistemas.com.br<br/>Endereço: Av. Rodrigo Otávio, 3000 - CDTECH - Sala 04 - UFAM. Coroado. CEP: 69077-000. Manaus/Amazonas.<br/>Centro de Desenvolvimento Empresarial e Tecnológico da UFAM<br/>Telefones: (92)4141-4100-C, 4141-8393-C e 8118-8393.</font><br/>"; | |
$emailcliente = "{$post['email']}"; | |
$mail = new PHPMailer(); | |
// Define os dados do servidor e tipo de conex�o | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->IsSMTP(); // Define que a mensagem ser� SMTP | |
// $email->SMTPSecure = "ssl"; // tbm j� tentei tls | |
$mail->Host = "mx10.webservidor.net"; // Endere�o do servidor SMTP (caso queira utilizar a autentica��o, utilize o host smtp.seudom�nio.com.br) | |
$mail->SMTPAuth = true; // Usa autentica��o SMTP? (opcional) | |
$mail->Username = '[email protected]'; // Usu�rio do servidor SMTP | |
$mail->Password = 'suasenha'; // Senha do servidor SMTP | |
// Define o remetente | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->From = "$emailcliente"; // Seu e-mail | |
$mail->Sender = "[email protected]"; // Seu e-mail | |
$mail->FromName = "SAC Móveis Iale"; // Seu nome | |
$mail->CharSet = "UTF-8"; | |
// | |
// | |
// Define os destinat�rio(s) | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->AddAddress('[email protected]', "{$post['nome']}"); | |
//$mail->AddAddress('[email protected]', 'Teste Locaweb'); | |
$mail->AddCC('[email protected]', "{$post['nome']}"); // Copia | |
//$mail->AddBCC('[email protected]', 'Fulano da Silva'); // C�pia Oculta | |
// Define os dados t�cnicos da Mensagem | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->IsHTML(true); // Define que o e-mail ser� enviado como HTML | |
//$mail->CharSet = 'iso-8859-1'; // Charset da mensagem (opcional) | |
// Define a mensagem (Texto e Assunto) | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->Subject = "{$post['assunto']}- Site IALE"; // Assunto da mensagem | |
$mail->Body = '<div align="center"><IMG src="http://moveisplanejadosiale.com.br/images/logo.png" width="290" heigth="110" alt="MRM Sistemas" class="wp-smiley"></div><br/>' . $msg; | |
$mail->AltBody = $font_texto . $msg . $ffont . '\r\n | |
<div align="center"><IMG src="http://www.mrmsistemas.com.br/home/sgc/_images/mrm03.png" alt="MRM Sistemas" class="wp-smiley"></div> '; | |
// Define os anexos (opcional) | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
//$mail->AddAttachment("/home/login/documento.pdf", "novo_nome.pdf"); // Insere um anexo | |
// Envia o e-mail | |
$enviado = $mail->Send(); | |
// Limpa os destinat�rios e os anexos | |
$mail->ClearAllRecipients(); | |
$mail->ClearAttachments(); | |
// Exibe uma mensagem de resultado | |
if ($enviado) { | |
echo "<script>alert('$mensagem');location='javascript:window.close();';</script>"; | |
} else { | |
echo "ERRO!<BR/><BR/>"; | |
echo "Informações do erro: | |
" . $mail->ErrorInfo; | |
} | |
// var_dump($post); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment