title: A simple way to send mails from a C application on Unix
body: <p>I am designing a system which will at some point require to send email notifications. So I am looking for a simple way to do this. Some background: the system will be running on Linux platform, there will be a working SMTP server somewhere on the network, the operator will configure its address, server credentials if required and a list of target email addresses (no, I am NOT working on a mass email system ;-). The process which will need to send the emails will be probably written in C, but super performance is not really a requirement, there won't be a lot of mails to send, so invoking some command-line tool is an acceptable option. Basically, what I tried in the past for similar tasks:</p>
  
  <ul>
  <li>Invoking local sendmail in command-line mode. This is a nightmare, because of the necessity to support the cryptic sendmail config. This is what I would really like to avoid.</li>
  <li>Talking to SMTP server port directly (EHLO, etc). This IS an option, but a bit too low-level for year 2008 ;-).</li>
  <li>Using some MUA which talks to local sendmail daemon acting as a mail relay. This is not nice exactly because it requires having local sendmail up and configured. </li>
  </ul>
  
  <p>So what I need is basically some library for C language or a simple command-line MUA which should be able to talk to remote sendmail (i.e. to talk to SMTP server that I tell it to), <b>but not requiring a local mail relay</b>. </p>
  
  <p>Any ideas are welcome!</p>