Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harkalygergo/d8c480acf6d45e6e54db11ee3d6f74a4 to your computer and use it in GitHub Desktop.
Save harkalygergo/d8c480acf6d45e6e54db11ee3d6f74a4 to your computer and use it in GitHub Desktop.
Alap űrlap feldolgozó e-mailben történő leküldéshez
<?php
// requirements: https://github.com/PHPMailer/PHPMailer
require 'assets/PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->charSet = 'UTF-8';
$mail->setFrom('valami@valami.hu', 'Server');
$mail->addAddress('neked@neked.hu', '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