Delta Chat Core C-API
mrsmtp.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Copyright (C) 2017 Björn Petersen
5  * Contact: r10s@b44t.com, http://b44t.com
6  *
7  * This program is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later
10  * version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see http://www.gnu.org/licenses/ .
19  *
20  ******************************************************************************/
21 
22 
23 #ifndef __MRSMTP_H__
24 #define __MRSMTP_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 #include "mrloginparam.h"
31 
32 
33 /*** library-private **********************************************************/
34 
35 typedef struct mrsmtp_t
36 {
37  mailsmtp* m_hEtpan;
38  char* m_from;
39  int m_esmtp;
40  pthread_mutex_t m_mutex;
41 
42  int m_log_connect_errors;
43  int m_log_usual_error;
44 
45  mrmailbox_t* m_mailbox; /* only for logging! */
46 } mrsmtp_t;
47 
48 mrsmtp_t* mrsmtp_new (mrmailbox_t*);
49 void mrsmtp_unref (mrsmtp_t*);
50 int mrsmtp_is_connected (const mrsmtp_t*);
51 int mrsmtp_connect (mrsmtp_t*, const mrloginparam_t*);
52 void mrsmtp_disconnect (mrsmtp_t*);
53 int mrsmtp_send_msg (mrsmtp_t*, const clist* recipients, const char* data, size_t data_bytes);
54 
55 
56 #ifdef __cplusplus
57 } /* /extern "C" */
58 #endif
59 #endif /* __MRPARAM_H__ */
60 
An object representing a single mailbox.
Definition: mrmailbox.h:194