M
M
Moolzv Rivers2019-08-08 15:25:30
linux
Moolzv Rivers, 2019-08-08 15:25:30

Cross-platform sending to mail in C?

Hello everyone, I didn’t find information anywhere, I know what it Сиis, winsock.hbut I need it to be under Linux.
That is, I can determine the OS preprocessor, but I can’t understand how it should look like, throw off someone where you can read to send emaila message through smtp.yandex.rufrom under Linuxand Windows?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Gornostaev, 2019-08-08
@SaddledSharp

#ifdef _WIN32
  #include <winsock2.h>
#else
  #include <sys/socket.h>
#endif

And just wrap WSAStartupit in macros. WSACleanupFor general tasks, it may be enough.

G
GavriKos, 2019-08-08
@GavriKos

https://github.com/somnisoft/smtp-client

R
Ruslan, 2019-08-10
@msHack

to support ssl, you will have to connect the openssl function library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question