Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once dirname(__FILE__) . '/vendor/phpmailer/PHPMailerAutoload.php';
- $name = '';
- $phone = '';
- $message = '';
- // adres strony
- $address = "https://ryzowapark.pl/";
- $redirectAddress = "https://ryzowapark.pl/";
- $name = isset($_POST['name']) ? $_POST['name'] : null;
- $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
- $message = isset($_POST['message']) ? $_POST['message'] : 'Brak';
- // mail account configuration
- $mail = new PHPMailer;
- $mail->SMTPDebug = 3; // Enable verbose debug output
- //Server settings
- $mail->SMTPDebug = 0; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'ryzowaparkk.nazwa.pl'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'sprzedaz@ryzowapark.pl'; // SMTP username
- $mail->Password = 'Chodkiewicza5'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- //Recipients
- $mail->setFrom('sprzedaz@ryzowapark.pl','Ryzowa Park');
- $mail->addAddress('kamil.jarzab@cravtt.com'); // Name is optional
- $mail->isHTML(true); // Set email format to HTML
- $mail->CharSet = 'UTF-8';
- $mail->Encoding = "base64";
- $mail->Subject = 'Ryzowa Park';
- $mail->Body = 'Imię i nazwisko: ' . $name . '<br>' . 'Telefon: ' . $phone . '<br>' . 'Wiadomość: ' . $message;
- $mail->AltBody = 'Imię i nazwisko: ' . $name . PHP_EOL . 'Telefon: ' . $phone . PHP_EOL . 'Wiadomość: ' . $message;
- if(!$mail->send()) {
- echo "Message has not been send";
- }else{
- echo "Message sent!";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement