Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be configured as a gmail smarthost but they are largely overkill for this use.
If you need to send an email with a text file (or binary file) as attachment using shell script or command prompt in Unix or Linux; try mutt – a terminal-based e-mail client for Unix-like systems.