-
Notifications
You must be signed in to change notification settings - Fork 26
/
mail.h
53 lines (42 loc) · 981 Bytes
/
mail.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef MAIL_H
#define MAIL_H
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
class Mail {
public:
Mail (std::string email = "") {
mail = fopen("kitti-eval-tool.log", "w");
/* Original code is stayed here for information,
* but we are not going to send e-mails
if (email.compare("")) {
mail = popen("/usr/lib/sendmail -t -f noreply@cvlibs.net","w");
fprintf(mail,"To: %s\n", email.c_str());
fprintf(mail,"From: noreply@cvlibs.net\n");
fprintf(mail,"Subject: KITTI Evaluation Benchmark\n");
fprintf(mail,"\n\n");
} else {
mail = 0;
}*/
}
~Mail() {
if (mail) {
//pclose(mail);
fclose(mail);
}
}
void msg (const char *format, ...) {
va_list args;
va_start(args,format);
if (mail) {
vfprintf(mail,format,args);
fprintf(mail,"\n");
}
vprintf(format,args);
printf("\n");
va_end(args);
}
private:
FILE *mail;
};
#endif