They could be different but will be similar…
Stunell is needed to proccess smtp or pop mail using ssl.
Which ports are you using for pop3 and smtp?
You need to add them to Stunnel.conf file.
GMail uses 995 and 587. And what about your program?
cert = stunnel.pem
# [b]Your Service[/b]
client=yes
# POP3 service, listens on localhost:11110
[gmail-pop3s]
accept=127.0.0.1:11110
connect=pop.gmail.com:[b]995[/b]
# SMTP service, listens on localhost:11025
[gmail-smtps]
protocol=smtp
accept=127.0.0.1:11025
connect=smtp.gmail.com:[b]587[/b]