Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_POST['send1']=='1')
- {
- define('CONF_SMTP_MAIL_NAME', 'Strona www');
- define('CONF_SMTP_MAIL_USER', 'praktyki2019@kud.pl'); // uzytkownik mail
- define('CONF_SMTP_MAIL_PASSWORD', 'Praktyki@2019'); // haslo mail
- define('CONF_SMTP_MAIL_SERVER', 'kud.nazwa.pl'); //sewer smtp
- define('CONF_SMTP_MAIL_PORT', '587'); // port
- define('CONF_SMTP_MAIL_SECURE', '\'TLS\'');
- require '_libraries/phpmailer/PHPMailerAutoload.php';
- $nazwisko=$_POST['nazwisko'];
- $email=$_POST['email'];
- $telefon=$_POST['telefon'];
- $tresc=$_POST['tresc'];
- $container='
- <!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;"> </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;">
- Imię i Nazwisko: <b>'.$nazwisko.'</b><br />
- Telefon: <b>'.$telefon.'</b><br />
- E-mail: <b>'.$email.'</b><br /><br />
- <small><b>Treść wiadomości:</b></small><br />'.$tresc.'
- </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>
- ';
- //mail
- $mailFrom=CONF_SMTP_MAIL_USER;
- $mail = new PHPMailer;
- $mail->CharSet = "UTF-8";
- $mail->SMTPDebug = 0; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = CONF_SMTP_MAIL_SERVER; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = CONF_SMTP_MAIL_USER; // SMTP username
- $mail->Password = CONF_SMTP_MAIL_PASSWORD; // SMTP password
- $mail->SMTPSecure = CONF_SMTP_MAIL_SECURE; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = CONF_SMTP_MAIL_PORT; // TCP port to connect to
- $mail->setFrom(CONF_SMTP_MAIL_USER, CONF_SMTP_MAIL_NAME);
- $mail->addAddress('szymon8866@gmail.com'); // Add a recipient
- //if(CONF_SMTP_KOPIA_ADRES=='1') { $mail->addBCC(CONF_SMTP_MAIL_USER); } // kopia na maila
- //$mail->AddReplyTo(CONF_EMAIL, CONF_FIRMA);
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Hotel TRPB: '.$nazwisko.'';
- $mail->Body = $container;
- if(!$mail->send()) {
- $mailInfo='error';
- $mailInfo.='Mailer Error: ' . $mail->ErrorInfo;
- $_SESSION['info'] ='<div class="blad"><b>Błąd !</b> Twoja wiadomość nie została wysłana</div>';
- $sendInfo='0';
- $typ='BLAD';
- } else {
- //$_SESSION['info'] ='<div class="info"><b>Dziękujemy !</b> Wiadomość została wysłana</div>';
- $sendInfo='1';
- $typ='SEND';
- }
- }
- echo''.$_SESSION['info'].'';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement