linux下C语言利用命令发送邮件
#include <stdio.h>
void
main() {
FILE
*file = popen(
"/usr/bin/mail -s 'Hello,world' root@localhost"
,
"w"
);
fprintf
(file,
"Nice to meet you !\n"
);
pclose(file);
}
|