Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('Etc/UTC');
- require 'PHPMailer-master/PHPMailerAutoload.php';
- //Create a new PHPMailer instance
- $mail = new PHPMailer;
- //Tell PHPMailer to use SMTP
- $mail->isSMTP();
- //Enable SMTP debugging
- // 0 = off (for production use)
- // 1 = client messages
- // 2 = client and server messages
- $mail->SMTPDebug = 2;
- //Ask for HTML-friendly debug output
- $mail->Debugoutput = 'html';
- //Set the hostname of the mail server
- $mail->Host = "184.154.150.68";
- //Set the SMTP port number - likely to be 25, 465 or 587
- $mail->Port = 587;
- //Whether to use SMTP authentication
- $mail->SMTPAuth = true;
- //Username to use for SMTP authentication
- $mail->Username = "no-reply@dev.agfmartins.com.br";
- //Password to use for SMTP authentication
- $mail->Password = "f00martins";
- //Set who the message is to be sent from
- $mail->setFrom(trim($_POST['email_remetente']), $_POST['nome_remetente']);
- //Set an alternative reply-to address
- // $mail->addReplyTo('replyto@example.com', 'First Last');
- //Set who the message is to be sent to
- $mail->addAddress(trim($_POST['email_destinatario']), $_POST['nome_destinatario']);
- //Set the subject line
- $mail->Subject = $_POST['assunto'];
- //Read an HTML message body from an external file, convert referenced images to embedded,
- //convert HTML into a basic plain-text alternative body
- $mail->msgHTML('<div style="text-align: center;"><img src="http://dev.agfmartins.com.br/loopimoveis.com.br/header.jpg" border="0" alt="" align="center" />
- <div style="text-transform: uppercase; font-family: \'Arial\', Verdana; font-weight: bold; text-align: center; font-size: 60px; padding: 20px 0px; color: #58595B;">' . $nomedestinatario . '</div>
- <img src="http://dev.agfmartins.com.br/loopimoveis.com.br/meio.jpg" border="0" alt="" align="center" />
- <br />
- <br />
- <br />
- <a href="http://dev.agfmartins.com.br/loopimoveis.com.br/MIDIA_KIT.pdf" target="_blank"><img src="http://dev.agfmartins.com.br/loopimoveis.com.br/clique-aqui.jpg" border="0" alt="clique aqui" align="center" /></a>
- <br />
- <br />
- <img src="http://dev.agfmartins.com.br/loopimoveis.com.br/footer.jpg" border="0" alt="" align="center" /></div>');
- //Replace the plain text body with one created manually
- // $mail->AltBody = '';
- //Attach an image file
- // $mail->addAttachment('images/phpmailer_mini.png');
- //send the message, check for errors
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo '<h1 style="text-align: center;">E-mail enviado com sucesso!</h1>';
- echo '<br />';
- echo '<a href="http://dev.agfmartins.com.br/loopimoveis.com.br/envio.php" style="text-align: center; position: relative; display: table; margin: 0px auto;">Voltar</a>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement