Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Mail using SMTP in C++ on Linux

Tags:

c++

linux

smtp

Can someone give me an example of how to send a mail using a C++ program? I have come across some programs but they are not that descriptive. I would also like to know what other libraries are there if I need more options.

like image 254
Prasanth Madhavan Avatar asked Dec 16 '10 07:12

Prasanth Madhavan


3 Answers

You might be interested in libcURL.

It's a great multi-platform C library which supports a lot of different protocols, including SMTP.

The official web page contains samples and tips to get you started.

Here is one that might help you.

Bindings exists for C++ (but I never used them) if you don't want to use the C interface.

like image 123
ereOn Avatar answered Sep 18 '22 22:09

ereOn


You can use libquickmail, see: http://sourceforge.net/projects/libquickmail/ This simple library allows you to easily send e-mail from C/C++ with attachments and even using SMTP authentication. It uses libcurl for the SMTP transport.

like image 22
Brecht Sanders Avatar answered Sep 20 '22 22:09

Brecht Sanders


Take a look at VMime, native C++. http://www.vmime.org/ Between the examples and the test suite, you should have everything you need.

like image 26
Billy O'Connor Avatar answered Sep 20 '22 22:09

Billy O'Connor