Solution:
First need to check SMTP Details like (SMTP Host,Encryption,SMTP Username adn SMTP Password) after that need to enable the less secure app in our gmail or yahoo settings.