how to rectify the following error ? SMTP server response: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it in php


Could we see the code that is generating this error message?
It helps with the debugging process, to be able to see the code ;-)

Also, you might want to consider abandoning the old PHP mail function and try one of the PHP mailer classes, like: PHPMailer or Swift Mailer.
They are generally much easier to deal with.