smtp c source code

versailles
versailles used Ask the Experts™
on
I look for a C source code  for an SMTP interface, i.e. for sending/receiving formated mails. Would someone know a stable code that I could compile on the various OS?
Thank you !
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017

Commented:
Are you building an email client?
UW-pine is available
.....
Top Expert 2015

Commented:
It is not so hard to program something with RFC821
versailleschercheur libre

Author

Commented:
Dear Gheist,
so you may have done it yourself if you are interested in the matter ? Have you an URL of that code ?
Best
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Top Expert 2015
Commented:
You must find a BSD/MIT/public domain SMTP library to send mails.
As I said naive RFC821 implementation should work in most cases.
Or just call external smtp program (like /usr/lib/sendmail)

You generally dont read mails via SMTP, as you are not a mail server. Here you use some protocol to access mailboxes on a mail server - e.g. IMAP (again seek a library)

Now extra: you can do RFC822/2822/MIME mangling yoursellf (library again?) or dedicate to external program/library.

Full reimplementation is not easy. Probably calling mail program is easiest, there are similar ones for Windows too.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
qmail has some examples... (qsmtpd)...
BSD mail / xmail comes to mind.

Then again if those are installed (on Windows use CYGWIN, mostly available by defailt on other plaforms) use just something like:

echo "message " | mail -s "Subject"  user@mailtarget.example.com
versailleschercheur libre

Author

Commented:
This is not what I really look for. I look for micro-smtp-server to micro-smtp-server dialog support able to send/recieve mails from/to other mail servers.
Best
nociSoftware Engineer
Distinguished Expert 2018

Commented:
So Qmail might have been the best fit anyway. As it is built using fairly simple code to run. Mail goal of qmail was to be secure. AFAIK it has never been cracked.
it has been written in C, is easy auditable (= readable).

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial