Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-type: text/html; charset=utf-8');
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- require 'phpmailer/src/Exception.php';
- require 'phpmailer/src/PHPMailer.php';
- require 'phpmailer/src/SMTP.php';
- $imie = $_POST['webinsider-input-imie'];
- $email = $_POST['webinsider-input-email'];
- $tresc = $_POST['webinsider-input-tresc'];
- $temat = $_POST['webinsider-input-temat'];
- date_default_timezone_set('Europe/Warsaw');
- $mail = new PHPMailer(true);
- try {
- $mail->SMTPDebug = 2;
- $mail->isSMTP(); // Używamy SMTP
- $mail->Host = 'restauracjadk61.pl'; // Adres serwera SMTP
- $mail->SMTPAuth = true; // Autoryzacja (do) SMTP
- $mail->Username = 'test@restauracjadk61.pl'; // Nazwa użytkownika
- $mail->Password = 'zaq1@WSX'; // Hasło
- $mail->SMTPSecure = 'ssl'; // Typ szyfrowania (TLS/SSL)
- $mail->Port = 1; // Port
- $mail->CharSet = "UTF-8";
- $mail->setLanguage('pl', '/phpmailer/language');
- $mail->setFrom('test@restauracjadk61.pl', 'WebInsider.pl');
- $mail->addAddress('test@restauracjadk61.pl', 'Patryk');
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'This is the HTML message body <b>in bold!</b>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->send();
- echo 'Message has been sent';
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- a
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement