Mails not arriving

Hi there, I am using the mail() funtion to send mails in my website and checking if they are sent with

if(mail($to, $subject, $message)){
echo ‘The message was sent successfully.’;
} else{
echo ‘There has been an error sending your message, try again later.’;

and getting confirmation that the mails are being sent to the servers. Is there a problem server side that´s not letting my mails through?

I recommend you use PHPMailer