E-mail sending PHP7 Ubuntu with error

0

I can not send email through my cloud account of Vultr. I have the account unlocked to send emails but nothing happens when I send it. I have installed sendmail and when I send an email via ssh or php it "sends" without errors.

<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if(!empty($_POST['contactname']) && !empty($_POST['contactemail']) && !empty($_POST['contactmessage'])) {
    $to = '[email protected]'; // Your e-mail address here.
    $body = "\nName: {$_POST['contactname']}\nEmail: {$_POST['contactemail']}\n\n\n{$_POST['contactmessage']}\n\n";
    mail($to, "Mensagem via Website", $body, "From: {$_POST['contactemail']}"); // E-Mail subject here.
    }
}
?>
    
asked by anonymous 09.01.2018 / 15:57

0 answers