How to check whether the mail has been successfully send using mail function in php?

Please reply me…

Hi Refilltuffy,

Welcome to the Sitepoint Forums!

There is no standard way to check whether the email was successfully delivered or not. Apart from some tricks whether the person had received/opened the email, you can only check like follow:


if(mail($to, $subject, $body, $headers)){
    echo 'E-mail sent successfully';
}
else{
    echo 'There was a problem while sending mail';
}