1 |
/* Declarations for public mail routines. |
2 |
* |
3 |
* IRC Services is copyright (c) 1996-2009 Andrew Church. |
4 |
* E-mail: <achurch@achurch.org> |
5 |
* Parts written by Andrew Kempe and others. |
6 |
* This program is free but copyrighted software; see the file GPL.txt for |
7 |
* details. |
8 |
*/ |
9 |
|
10 |
#ifndef MAIL_H |
11 |
#define MAIL_H |
12 |
|
13 |
/*************************************************************************/ |
14 |
|
15 |
/* Completion callback type: */ |
16 |
typedef void (*MailCallback) (int status, void *data); |
17 |
|
18 |
/* Constants for mail delivery results, passed to the sendmail() completion |
19 |
* callback: */ |
20 |
#define MAIL_STATUS_SENT 0 /* Mail sent successfully */ |
21 |
#define MAIL_STATUS_ERROR 1 /* Some unspecified error occurred */ |
22 |
#define MAIL_STATUS_NORSRC 2 /* Insufficient resources available */ |
23 |
#define MAIL_STATUS_REFUSED 3 /* Remote system refused message */ |
24 |
#define MAIL_STATUS_TIMEOUT 4 /* Mail sending timed out */ |
25 |
#define MAIL_STATUS_ABORTED 5 /* Mail sending aborted (e.g. module |
26 |
* removed while sending) */ |
27 |
|
28 |
/*************************************************************************/ |
29 |
|
30 |
/* Send mail to the given address, calling the given function (if any) on |
31 |
* completion or failure. */ |
32 |
extern void sendmail(const char *to, const char *subject, const char *body, |
33 |
const char *charset, |
34 |
MailCallback completion_callback, void *callback_data); |
35 |
|
36 |
/*************************************************************************/ |
37 |
|
38 |
#endif /* MAIL_H */ |
39 |
|
40 |
/* |
41 |
* Local variables: |
42 |
* c-file-style: "stroustrup" |
43 |
* c-file-offsets: ((case-label . *) (statement-case-intro . *)) |
44 |
* indent-tabs-mode: nil |
45 |
* End: |
46 |
* |
47 |
* vim: expandtab shiftwidth=4: |
48 |
*/ |