Allah T'ala says in the Holy Quran:

يَا أَيُّهَا النَّبِيُّ إِنَّا أَرْسَلْنَاكَ شَاهِدًا وَمُبَشِّرًا وَنَذِيرًا
 
(33:45) O Prophet, We have sent you as a witness, a bearer of good news and a warner.
 One should note that a person's giving the good news of a good end for belief and righteous acts and the warning of an evil end for disbelief and evil acts, in his personal capacity, is a different thing, and another's being appointed by Allah as a bearer of the good news and a warner is quite another thing. The one who is appointed to this office by Allah necessarily possesses an authority to give the good news and administer the warnings due to which his good news and his warnings are invested with legality. His giving a good news for an act has the meaning that the Greatest of alI Judges, Who has sent him, approves of the act and holds it worthy of a reward; so, it is certainly imperative or obligatory or commendable in nature, and its doer will surely get a reward. On the other hand, his giving a warning of an evil end for an act has the meaning that the Sovereign forbids that act; so, it is certainly sinful and unlawful, and its doer will surely be punished. The good news and warnings of the one who is not divinely appointed cannot ever be invested with such an authority.