Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

Why is php mail function not working with mail.ru

$
0
0

My code is working with Gmail and Yandex emails but it did not send thank you message to mail.ru users can someone help me with this??

`

if (isset($_POST['submit'])) {


if (isset($_POST['name'])) {
    $name = trim(htmlspecialchars($_POST['name']));
}


if (isset($_POST['email'])) {
    $email = trim(htmlspecialchars($_POST['email']));
}

if (isset($_POST['message'])) {
    $message = trim(htmlspecialchars($_POST['message']));
}
$to = "mariemolye@gmail.com";
$from = "request@info.am";
$from2 = $_POST['email'];
$subject = "Contact us";
$subject2 = "Message";
$message =  "\r\nName - " . $name . "\r\nEmail - " . $email . "\r\nMessage - " . $message;
$message2 = "Thank you for using our services and for connecting with us.";
$headers = "From:" . $from;
$headers2 = "From:" . $to;
try {
    if (mail($to, $subject, $message, $headers)) {
        mail($from2,$subject2,$message2,$headers2);
        header('Location: ./confirm.html');
        exit;
    }
} catch (Exception $e) {
    echo $e->getMessag();
}
}

`


Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>