Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.04 KB | None | 0 0
  1. <?php
  2. if($_POST['send1']=='1')
  3. {
  4.  
  5. define('CONF_SMTP_MAIL_NAME', 'Strona www');
  6. define('CONF_SMTP_MAIL_USER', 'praktyki2019@kud.pl'); // uzytkownik mail
  7. define('CONF_SMTP_MAIL_PASSWORD', 'Praktyki@2019'); // haslo mail
  8. define('CONF_SMTP_MAIL_SERVER', 'kud.nazwa.pl'); //sewer smtp
  9. define('CONF_SMTP_MAIL_PORT', '587'); // port
  10. define('CONF_SMTP_MAIL_SECURE', '\'TLS\'');
  11.  
  12. require '_libraries/phpmailer/PHPMailerAutoload.php';
  13. $nazwisko=$_POST['nazwisko'];
  14. $email=$_POST['email'];
  15. $telefon=$_POST['telefon'];
  16. $tresc=$_POST['tresc'];
  17.  
  18.                                                 $container='
  19.                                                     <!DOCTYPE html><html lang="pl"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Strona www</title><style type="text/css">html,body{margin:0;padding:0;height:100% !important;width:100% !important;color:#000;font-family:Arial,\'Helvetica Neue\',Helvetica,sans-serif}*{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{color:#000;text-decoration:none}table,td{mso-table-lspace:0pt;mso-table-rspace:0pt}table{border-spacing:0 !important}table{border-collapse:collapse;margin:0 auto}@media only screen and (min-width:601px){.email-container{width:600px !important}}@media only screen and (max-width:600px){.email-container{width:100% !important;max-width:none !important}}</style><!--[if mso]><style type=”text/css”>body,html,td,p{font-family:Arial,\'Helvetica Neue\',Helvetica,sans-serif}</style><![endif]--></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#f3f3f3" style="margin:0;padding:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;"><table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" bgcolor="#f3f3f3" style="border-collapse:collapse;"><tr><td><!--[if (gte mso 9)|(IE)]><table width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]--><table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" style="max-width:600px;margin:auto;" class="email-container"><tr><td><table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="#ffffff" style="background:#ffffff;"><tr><td valign="middle" style="color:#797979;padding:30px 0;text-align:center;" width="192">Wiadomość e-mail ze strony <b></b></td></tr></table><table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="#ffffff"><tr><td width="4%" height="4%" class="stack-column" style="background:#aaaaaa;">&nbsp;</td></tr><tr><td valign="middle" align="center" style="background:#a6a6a6;"><p style="padding:0 10px;"></p></td></tr><tr><td style="padding:40px;background:#fff;"><table border="0" width="100%" cellpadding="0" cellspacing="0" align="center"><tr><td valign="top" style="font-size:15px;line-height:20px;color:#454545;text-align:left;" class="stack-column-center;">
  20.                                                         Imię i Nazwisko: <b>'.$nazwisko.'</b><br />
  21.                                                         Telefon: <b>'.$telefon.'</b><br />
  22.                                                         E-mail: <b>'.$email.'</b><br /><br />
  23.                                                         <small><b>Treść wiadomości:</b></small><br />'.$tresc.'
  24.                                                     </td></tr></table></td></tr><tr><td style="padding:20px 0 20px 40px;background:#f5f5f5;"><table cellspacing="0" cellpadding="0" border="0" width="100%" style=""><tr><td valign="top" align="left" style="padding:0;font-size:12px;line-height:1.3;color:#797979;text-transform:uppercase;">Wiadomość wysłana <b>'.$data.'</b>z adresu ip <b>'.$ip.'</b></td></tr></table></td></tr><tr><td valign="middle" align="center" style="color:#ffffff;background:#656565;font-size:18px;padding:10px 40px 10px 40px;"></td></tr></table></td></tr></table><!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--></td></tr></table></body></html>                                            
  25.                                                 ';     
  26.                                                
  27.                                                 //mail
  28.                                                     $mailFrom=CONF_SMTP_MAIL_USER;
  29.                                                     $mail = new PHPMailer;
  30.                                                     $mail->CharSet = "UTF-8";
  31.                                                     $mail->SMTPDebug = 0;                                 // Enable verbose debug output
  32.                                                     $mail->isSMTP();                                      // Set mailer to use SMTP
  33.                                                     $mail->Host = CONF_SMTP_MAIL_SERVER;                  // Specify main and backup SMTP servers
  34.                                                     $mail->SMTPAuth = true;                               // Enable SMTP authentication
  35.                                                     $mail->Username = CONF_SMTP_MAIL_USER;                        // SMTP username
  36.                                                     $mail->Password = CONF_SMTP_MAIL_PASSWORD;                  // SMTP password
  37.                                                     $mail->SMTPSecure = CONF_SMTP_MAIL_SECURE;                            // Enable TLS encryption, `ssl` also accepted
  38.                                                     $mail->Port = CONF_SMTP_MAIL_PORT;                                    // TCP port to connect to
  39.                                                     $mail->setFrom(CONF_SMTP_MAIL_USER, CONF_SMTP_MAIL_NAME);
  40.                                                     $mail->addAddress('szymon8866@gmail.com');     // Add a recipient
  41.                                                     //if(CONF_SMTP_KOPIA_ADRES=='1') { $mail->addBCC(CONF_SMTP_MAIL_USER); } // kopia na maila
  42.                                                     //$mail->AddReplyTo(CONF_EMAIL, CONF_FIRMA);                                                                                       
  43.                                                     //Content
  44.                                                     $mail->isHTML(true);                                  // Set email format to HTML
  45.                                                     $mail->Subject = 'Hotel TRPB: '.$nazwisko.'';
  46.                                                     $mail->Body    = $container;
  47.                                                    
  48.  
  49.                                            
  50.                                                         if(!$mail->send()) {                                                             
  51.                                                             $mailInfo='error';
  52.                                                             $mailInfo.='Mailer Error: ' . $mail->ErrorInfo;
  53.                                                             $_SESSION['info'] ='<div class="blad"><b>Błąd !</b> Twoja wiadomość nie została wysłana</div>';  
  54.                                                             $sendInfo='0';
  55.                                                             $typ='BLAD';
  56.                                                         } else {                                                           
  57.                                                             //$_SESSION['info'] ='<div class="info"><b>Dziękujemy !</b> Wiadomość została wysłana</div>'; 
  58.                                                             $sendInfo='1';
  59.                                                             $typ='SEND';                                                           
  60.                                                         }
  61. }
  62.                                                        
  63. echo''.$_SESSION['info'].'';
  64.  
  65.  
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement