I'm working on an email client for Windows, and to send emails, my application needs to have the email address and the password of that email address. When the user gives his password, I store it encrypted. When sending an email, I pass the decrypted password. But there is one problem here: if I just encrypt a password, someone can easily decrypt the password if they have the key and this key is easy to get when decompling my application and finding the key. But I also can't hash the password because I need to pass the password in plain text and I don't want to annoy my users by asking the password every time they start my application.
So how can I store the password safely without hashing it?
Note: I have read this question: Keeping a user's passwords, but can't hash them , but that's for a web application and I have a desktop application so I can't use a server.