Zdravím Vás chcel by som sa spýtať ako pripojiť PHP mail script k database (aby som dostal report do MySql databazy)
dakujem
<?php
$errors = '';
$myemail = 'MOJ MAIL';
if(empty($_POST['a_line']) ||
empty($_POST['email']) ||
empty($_POST['c_line']) ||
empty($_POST['d_line']) ||
empty($_POST['e_line']) ||
empty($_POST['f_line']) ||
empty($_POST['g_line']))
{
$errors .= "\n Error: all fields are required";
}$a_line = $_POST['a_line'];
$email_address = $_POST['email'];
$c_line = $_POST['c_line'];
$d_line = $_POST['d_line'];
$e_line = $_POST['e_line'];
$f_line = $_POST['f_line'];
$g_line = $_POST['g_line'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}if( empty($errors))
{
$to = $myemail;
$email_subject = "Objednavka: $a_line";
$email_body = "You have received a new message. ".
"\n Objednal: $a_line \n Email: $email_address\n Typ:$c_lin\n Od Kedy:$d_line\n Do Kedy:$e_line\n Zľavové karty ISIC/EURO26$f_line\n Poziadavky:$g_line";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);header('Location: dikes.html');
}
?>sender
<?php
echo nl2br($errors);
?>