🔥 Öne Çıkan Konular

E.Mail gönderimin de, "Sorry , it seems that my mail server is not responding. Please try again later!" hatası.

Bu konuyu okuyanlar

ThorT

Öğrenci
Katılım
13 Haziran 2018
Mesajlar
1
Reaksiyon puanı
0
Puanları
1
Yaş
53
Merhaba.
İletişim kutusundan e posta göndermek istediğimde yukarıdaki hatayı almaktayım.
Gereken yerleri doldurdum ama yukarıdaki hata msajı gelmekte.
Yardım ihtiyacım var. :) Şimdiden teşekkürler.

Dosya Adı:
contact_me.php

Kodları:
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo json_encode(array('error'=>'true'));
return false;
}

$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];

$lastname = $_POST['lastname'];
$phone = $_POST['phone'];
$subject = ($_POST['subject'] ? $_POST['subject'] : "Website Contact Form: $name");



// Create the email and send the message
$to = 'info@makaraci.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
$email_subject = $subject;
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nLast Name: $lastname\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
$headers = "From: 'info@makaraci.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
echo json_encode(array('success'=>'true'));
return true;
?>

-------------------------------
Dosya Adı :
contact_me.js

Kodlar :
$(function() {
$("input,textarea").jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {
// additional error messages or events
},
submitSuccess: function($form, event) {
event.preventDefault(); // prevent default submit behaviour
// get values from FORM
var name = $("input#user-name").val();
var lastname = $("input#user-lastname").val();
var email = $("input#user-email").val();
var phone = $("input#user-phone").val();
var subject = $("input#user-subject").val();
var message = $("textarea#user-message").val();
var firstName = name; // For Success/Failure Message
// Check for white space in name for Success/Fail message
if (firstName.indexOf(' ') >= 0) {
firstName = name.split(' ').slice(0, -1).join(' ');
}
$.ajax({
url: "././mail/contact_me.php",

type: "POST",
dataType: 'json',
data: {
name: name,
lastname: lastname,
email: email,
phone: phone,
subject: subject,
message: message
},
cache: false,
success: function(data) {
if(data.error){
// Fail message
$('#success').html("<div class='alert alert-danger'>");
$('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;").append("</button>");
$('#success > .alert-danger').append("<strong>Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!");
$('#success > .alert-danger').append('</div>');
//clear all fields
$('#contactForm').trigger("reset");
}
else if(data.success){
// Success message
$('#success').html("<div class='alert alert-success'>");
$('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;").append("</button>");
$('#success > .alert-success').append("<strong>Your message has been sent. </strong>");
$('#success > .alert-success').append('</div>');
//clear all fields
$('#contactForm').trigger("reset");
}
}
})
},
filter: function() {
return $(this).is(":visible");
},
});
});


/*When clicking on Full hide fail/success boxes */
$('#name').focus(function() {
$('#success').html('');
});

------------------------------
Dosya Adı :
iletisim.html

İletişim Formu Kodları :

<form novalidate id="contactForm" class="reply-form form-inline">
<div class="row form-elem">
<div class="col-sm-6 form-elem">
<div class="default-inp form-elem">
<i class="fa fa-user"></i>
<input type="text" name="user-name" id="user-name" placeholder="Tam İsminiz :" required>
</div>
<div class="default-inp form-elem">
<i class="fa fa-envelope"></i>
<input type="text" name="user-email" id="user-email" placeholder="E Posta Adresiniz : " required>
</div>
</div>
<div class="col-sm-6 form-elem">
<div class="default-inp form-elem">
<i class="fa fa-user"></i>
<input type="text" name="user-lastname" id="user-lastname" placeholder="Soyadınız :">
</div>
<div class="default-inp form-elem">
<i class="fa fa-phone"></i>
<input type="text" name="user-phone" id="user-phone" placeholder="Telefon Numaranız :">
</div>
</div>
</div>
<div class="default-inp form-elem">
<input type="text" name="user-subject" id="user-subject" placeholder="Konu :">
</div>
<div class="form-elem default-inp">
<textarea id="user-message" placeholder="Mesajınız :"></textarea>
</div>
<div class="form-elem">
<button type="submit" class="btn btn-success btn-default">Gönderİn</button>
</div>
</form>
 

Son mesajlar

Üst