Created
June 24, 2017 15:32
-
-
Save harkalygergo/d8c480acf6d45e6e54db11ee3d6f74a4 to your computer and use it in GitHub Desktop.
Alap űrlap feldolgozó e-mailben történő leküldéshez
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// requirements: https://github.com/PHPMailer/PHPMailer | |
require 'assets/PHPMailer/PHPMailerAutoload.php'; | |
$mail = new PHPMailer; | |
$mail->charSet = 'UTF-8'; | |
$mail->setFrom('[email protected]', 'Server'); | |
$mail->addAddress('[email protected]', 'Neked'); | |
$mail->isHTML(false); | |
$mail->Subject = 'Új levél'; | |
$message = "Űrlap kitöltve ezzel: \n"; | |
foreach ($_POST as $key => $value) | |
{ | |
$message .= $key.': '.$value."\n"; | |
} | |
$mail->Body = $message; | |
if(!$mail->send()) | |
{ | |
echo 'Hiba: ' . $mail->ErrorInfo; | |
} | |
else | |
{ | |
echo 'siker'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment