|
|
@@ -4155,6 +4155,8 @@ int smtp_init(void)
|
|
|
|
|
|
dev_smtp_init(h->gdm->db, &h->gdm->smtp_sett);
|
|
|
thread_start(THREAD_ID_SMTP, smtp_thread, h, 5*MB, 0);
|
|
|
+
|
|
|
+ //smtp_test();
|
|
|
#endif
|
|
|
|
|
|
return 0;
|
|
|
@@ -4193,10 +4195,36 @@ int smtp_send(char *sub, char *body)
|
|
|
int smtp_test(void)
|
|
|
{
|
|
|
int r=0,cnt=0;
|
|
|
+ char temp[200];
|
|
|
|
|
|
#ifdef USE_SMTP
|
|
|
+ smtp_sett_t sett={
|
|
|
+ .man = {
|
|
|
+ .product_id = 0,
|
|
|
+ .mode = 1,
|
|
|
+ .account = "rcp064867@163.com",
|
|
|
+ .password = "wanhong0219107X",
|
|
|
+ .server = "smtp.163.com",
|
|
|
+ .port = "25",
|
|
|
+ .auth = "PLAIN",
|
|
|
+ },
|
|
|
+
|
|
|
+ .rcv = {
|
|
|
+ .recv = {
|
|
|
+ {0, 1, "1556907721@qq.com"},
|
|
|
+ {1, 1, "cijiu0219@sina.com"},
|
|
|
+ {2, 1, "jiuci4902@gmail.com"},
|
|
|
+ {3, 1, "cijiu0219@hotmail.com"},
|
|
|
+ {4, 1, "cijiu990219@outlook.com"},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
+ char *sub="123";
|
|
|
+ char *body="hello everyone";
|
|
|
while(cnt++<10) {
|
|
|
- r = smtp_send("123", "hello 123!");
|
|
|
+ sprintf(temp, "%s %d", body, cnt);
|
|
|
+ r = smtp_send(sub, temp);
|
|
|
sleep(2);
|
|
|
}
|
|
|
#endif
|