Aşağıdaki şekilde bir iletişim formum var fakat maillerim iletilmiyor anlamadım yardımcı olabilir misiniz. Şimdiden teşekkür ederim.
<?php
// After form submit checking everything for email sending
if(isset($_POST['form_contact']))
{
$statement = $pdo->prepare("SELECT * FROM tbl_settings WHERE id=1");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row)
{
$contact_form_email = $row['contact_form_email'];
$contact_form_email_subject = $row['contact_form_email_subject'];
$contact_form_email_thank_you_message = $row['contact_form_email_thank_you_message'];
}
$valid = 1;
if(empty($_POST['visitor_name']))
{
$valid = 0;
$error_message1 .= 'Please enter your name.\n';
}
if(empty($_POST['visitor_phone']))
{
$valid = 0;
$error_message1 .= 'Please enter your phone number.\n';
}
if(empty($_POST['visitor_email']))
{
$valid = 0;
$error_message1 .= 'Please enter your email address.\n';
}
else
{
// Email validation check
if(!filter_var($_POST['visitor_email'], FILTER_VALIDATE_EMAIL))
{
$valid = 0;
$error_message1 .= 'Please enter a valid email address.\n';
}
}
if(empty($_POST['visitor_comment']))
{
$valid = 0;
$error_message1 .= 'Please enter your comment.\n';
}
if($valid == 1)
{
$visitor_name = strip_tags($_POST['visitor_name']);
$visitor_email = strip_tags($_POST['visitor_email']);
$visitor_phone = strip_tags($_POST['visitor_phone']);
$visitor_comment = strip_tags($_POST['visitor_comment']);
$kime = "info@akareyazilim.com";
$konu = $visitor_name;
$mesaj = $visitor_comment."<BR>".$visitor_phone;
mail($kime, $konu, $mesaj);
}
}
?>
Mail fonksiyonunun çalışması için herhalde sunucu tarafından etkin olması gerekiyordu. Hosting sağlayıcınıza sorabilirsiniz. SMTP kullanarak mail atmanız daha sağlıklı olabilir.