I don't know in which language/platform you are developing your applications, but for .NET you can take advantage of encrypting and decrypting configuration sections.
To my knowledge these sections are meant to store sensitive data, like passwords. You can also place other date, like SMTP server, account, etc. in it.
I'm pretty sure other languages have similar protection mechanisms.
One thing I saw for the Orchard CMS installations, the username and password for databases are stored (in plain text) in the App_Data folder. Users can't really access these folders, so it's rather safe, but if your server/web application gets hacked, one could easily gain access in the database.
If you want to be sure, encrypt the information, but make sure you can decrypt it in your application.