Merhaba,

Yakın zamanda themeforest üzerinden html bir tasarım satın aldım. Bu tasarımda bulunan iletişim formu php mail fonksiyonu ile mail gönderiyor fakat bildiğiniz gibi hemen hemen her sunucuda php mail fonksiyonu kapalı. Eğer yardım edebilecek biri varsa aşağıda ileteceğim form kodlarını smtp ile gönderilebilmesi için düzenleyebilir mi?

Şimdiden teşekkür ediyorum.


$errors = array();
// array to hold validation errors
$data = array();
// array to pass back data
$service = '';
$number = '';

$data['success'] = true;
$data['messageSuccess'] = 'Hey! Thanks for reaching out. I will get back to you soon';

// CHANGE THE TWO LINES BELOW
$page = $_POST['pageId'];
$postData = $_POST['data'];

if ($page == 'testimonial') {

if (isset($postData['selectOption'])) {
$service = "Service: " . $postData['selectOption'] . "";
}

if (isset($postData['phoneNo'])) {
$number = "Phone no.: " . $postData['phoneNo'] . "";
}
$email_to = "kuldeep@sparxitsolutions.com";
$email_subject = $postData['subject'];
$name = $postData['name'];
$email_from = $postData['email'];
$cc = "shyam.sunder@sparxtechnologies.com";
$message = $postData['message'];

// Form Message begin
$email_subject = "BusinessPlus";
$email_message = "



" . $service . $number . "
Form details below:
Name: " . $name . "
Email: " . $email_from . "
Message: " . $message . "
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'Reply-To: ' . $email_from . "\r\n";
$headers .= 'From: ' . $email_from . "\r\n";
$headers .= 'Cc: ' . $cc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
// Send Mail
@mail($email_to, $email_subject, $email_message, $headers);
}

// Contact-Us form comes from Footer contacts -Us form
if ($page == 'contactUs') {


if (isset($postData['selectOption'])) {
$service = "Service: " . $postData['selectOption'] . "";
}

if (isset($postData['phoneNo'])) {
$number = "Phone no.: " . $postData['phoneNo'] . "";
}

$email_to = "anshika.yadav@sparxitsolutions.com";
$email_subject = $postData['subject'];
$name = $postData['name'];
$email_from = $postData['email'];
$cc = "shyam.sunder@sparxtechnologies.com";
$message = $postData['message'];

// Form Message begin
$email_subject = "BusinessPlus";
$email_message = "



" . $service . $number . "
Form details below:
Name: " . $name . "
Email: " . $email_from . "
Message: " . $message . "
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'Reply-To: ' . $email_from . "\r\n";
$headers .= 'From: ' . $email_from . "\r\n";
$headers .= 'Cc: ' . $cc . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
// Send Mail
@mail($email_to, $email_subject, $email_message, $headers);
}

// To send HTML mail, the Content-type header must be set

//}

// return a response ===========================================================
// response if there are errors

if (!empty($errors)) {
// if there are items in our errors array, return those errors
$data['success'] = false;
$data['errors'] = $errors;
$data['messageError'] = '*Note: Please check the fields in red';
}
// return all our data to an AJAX call
echo json_encode($data);
?>