IsSMTP();
$mail->Host = 'smtp.udag.de';
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = 'pferdekrankenversicherungde-0001';
$mail->Password = '74656170';
$mail->SMTPSecure = 'tls';
$mail->Subject = stripslashes($subject);
$mail->From = $mailfrom;
$mail->FromName = $mailfrom;
$mailto_array = explode(",", $mailto);
for ($i = 0; $i < count($mailto_array); $i++)
{
if(trim($mailto_array[$i]) != "")
{
$mail->AddAddress($mailto_array[$i], "");
}
}
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n
";
throw new Exception($error);
}
$mail->AddReplyTo($mailfrom);
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
}
}
$mail->CharSet = 'ISO-8859-1';
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
if (is_array($_FILES[$key]['name']))
{
$count = count($_FILES[$key]['name']);
for ($file = 0; $file < $count; $file++)
{
$mail->AddAttachment($_FILES[$key]['tmp_name'][$file], $_FILES[$key]['name'][$file]);
}
}
else
{
$mail->AddAttachment($_FILES[$key]['tmp_name'], $_FILES[$key]['name']);
}
}
}
}
$mail->WordWrap = 80;
$mail->Body = $message;
$mail->Send();
if (!ValidateEmail($autoresponder_from))
{
$error .= "The specified autoresponder email address (" . $autoresponder_from . ") is invalid!\n
";
throw new Exception($error);
}
$mail->ClearAddresses();
$mail->ClearAttachments();
$mail->Subject = stripslashes($autoresponder_subject);
$mail->From = $autoresponder_from;
$mail->FromName = $autoresponder_from;
$mail->AddAddress($autoresponder_to, "");
$mail->AddReplyTo($autoresponder_from);
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$autoresponder_message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$autoresponder_message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$mail->IsHTML(false);
$mail->WordWrap = 80;
$mail->Body = $autoresponder_message;
$mail->Send();
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>