예제 #1
0
$assunto = $_POST['assunto'];
$mensagem = $_POST['mensagem'];
require_once "PHPMailer-master/PHPMailerAutoload.php";
$mail = new Phpmailer();
$mail->issmtp();
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "******";
$mail->Password = "******";
$mail->setFrom("*****@*****.**", "Email de Contato do Site");
$mail->addAddress("*****@*****.**");
$mail->Subject = "Email de contato do Site";
$mail->msgHTML("<html>de: {$nome}<br/>email: {$email}<br/>Fone: {$telefone}<br>Assunto: {$assunto}<br>Mensagem: {$mensagem}</html>");
if ($mail->send()) {
    ?>
	

	
	<script>

		alert("Mensagem Enviada com Sucesso!!!");

		window.location = "contato.php";

	</script>';		
    
    <?php 
} else {
    echo "Erro ao enviar mensagem " . $mail->ErrorInfo;
예제 #2
0
 function sendMail($file_name_sql)
 {
     require_once 'Phpmailer.php';
     $mailObj = new Phpmailer();
     $datetime = date("Y-m-d H:i:s");
     $firstname = "IOSS";
     $email = "*****@*****.**";
     $FILE_NAME = $file_name_sql;
     $mailBodyDetails = "Please find the attachment containing Infinite MLM Software database backup.\n<br/><br/> File name : {$file_name_sql} <br/>\n<br/>To Download File click here https://infinitemlmsoftware.com/soft/binary/db_backup/dump/{$file_name_sql} <br/><br/>\n                           Keep this file safe in order to restore the database if required.\n                           Regards,<br /><b>Team IOSS</b><br />https://www.ioss.in";
     $mailObj->From = $email;
     $mailObj->FromName = $firstname;
     $mailObj->Subject = "CRM Backup - " . $datetime;
     $mailObj->IsHTML(true);
     $mailObj->Body = $mailBodyDetails;
     $mailObj->ClearAddresses();
     $mailObj->AddAddress('*****@*****.**');
     //PASSWORD:cander1055mlm
     //if($FILE_NAME !="")
     //$mailObj->AddAttachment($FILE_NAME);
     if (!$mailObj->send()) {
         echo "Mailer Error: " . $mailObj->ErrorInfo;
     } else {
         echo "Message sent!";
         $cmd = "rm {$FILE_NAME}";
         exec($cmd);
     }
     //echo $FILE_NAME;
 }