Connect to remote host with ssh (assume vncserver is runing on 5901 port)
$ ssh -L 5902:localhost:5901 user@remotehost
Run vncviewer
$ vncviewer localhost:2
For windows using PuTTY
Add forwarded port:
Connection > SSH > Tunnels
Source port: 5902
Destination: localhost:5901
click [Add]
Connect and then run vncviewer localhost:2
Download and install msmtp
Create .msmtprc
with following lines:
account default
host smtp.gmail.com
port 587
from me@gmail.com
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user me@gmail.com
password gmailpassword
logfile ~/.msmtp
$ chmod 600 ~/.msmtp
$ msmtp -t < somefile
First lines of 'somefile' should be header info such as To:, From:, Subject:.