Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once('web-files/site/phpmail/PHPMailerAutoload.php');
- $mail = new PHPMailer();
- $mail->IsHTML(true); // envio como HTML se 'true'
- $mail->IsSMTP(); // send via SMTP
- $mail->SMTPAuth = true; // 'true' para autentica��o
- $mail->Port = 587;
- $mail->Mailer = "smtp"; //Usando protocolo SMTP
- $mail->Host = "smtp.soumulti.com.br"; //seu servidor SMTP
- $mail->Username = "naoresponda@o2multi.com.br";
- $mail->Password = "editar2014"; // senha de SMTP
- $mail->From = "naoresponda@o2multi.com.br";
- $mail->FromName = "Contato Camilo";
- $mail->CharSet = "UTF-8";
- $mail->SetFrom('naoresponda@o2multi.com.br', 'Camilo');
- $mail->AddAddress($destino, $nome); //alterar email aqui
- $mail->addAddress('programacao@o2multi.com.br', 'Camilo');
- $mail->Subject = $assunto;
- //$mail->SMTPDebug = 2;
- foreach ($_POST as $key => $valor) {
- if (($key != 'x') && ($key != 'y')) {
- $campos[] = $key;
- $valores[] = $valor;
- }
- }
- $html = '';
- for ($i = 0; $i < count($campos); $i++) {
- $field = ucwords(str_replace('-', ' ', $campos[$i]));
- $field = ucwords(str_replace('_', '/', $field));
- $values = $valores[$i];
- if ($field == 'mensagem') {
- $html .= $field . '<br>' . nl2br($values) . '<br>';
- } else {
- $html .= $field . ': ' . $values . '<br>';
- }
- }
- $html = utf8_encode($html);
- $mail->MsgHTML($html);
- if (!$mail->Send()) {
- return 0;
- } else {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement