67 lines
1.4 KiB
C
67 lines
1.4 KiB
C
/******************************************************************************
|
|
*
|
|
* Copyright (c) 2017-2019 by Löwenware Ltd
|
|
* Please, refer LICENSE file for legal information
|
|
*
|
|
******************************************************************************/
|
|
|
|
/**
|
|
* @file mail.h
|
|
* @author Ilja Kartašov <ik@lowenware.com>
|
|
* @brief Mail sending component header file
|
|
*
|
|
* @see https://lowenware.com/aisl/
|
|
*/
|
|
|
|
#ifndef AISLX_MAIL_H_2738BEC4_CF82_4D77_A41F_0E2615848194
|
|
#define AISLX_MAIL_H_2738BEC4_CF82_4D77_A41F_0E2615848194
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <aisl/aisl.h>
|
|
#include <uuid/uuid.h>
|
|
|
|
|
|
#ifndef AISLX_MAIL_FORMAT
|
|
|
|
#define AISLX_MAIL_FORMAT \
|
|
"Date: %s\r\n" \
|
|
"To: %s\r\n" \
|
|
"From: %s\r\n" \
|
|
"Reply-To: %s\r\n" \
|
|
"Message-ID: %s\r\n" \
|
|
"Subject: %s\r\n" \
|
|
"\r\n" \
|
|
"%s" \
|
|
"\r\n" \
|
|
|
|
#endif
|
|
|
|
struct aislx_mail
|
|
{
|
|
pthread_t thread;
|
|
const char *to;
|
|
const char *reply_to;
|
|
const char *from;
|
|
const char *subject;
|
|
const char *msg;
|
|
uuid_t msg_id;
|
|
};
|
|
|
|
typedef struct aislx_mail * aislx_mail_t;
|
|
|
|
|
|
aisl_status_t
|
|
aislx_mail_send( aislx_mail_t mail,
|
|
const char *smtp_server,
|
|
const char *smtp_user,
|
|
const char *smtp_pass,
|
|
int flags );
|
|
|
|
|
|
aisl_status_t
|
|
aislx_mail_get_status(aislx_mail_t mail);
|
|
|
|
|
|
#endif /* !AISLX_MAIL_H */
|