#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);
}

 在监控系统里面,发现异常需要邮件报告时,可以使用popen的"w"方式写入邮件

相关文章:

  • 2022-12-23
  • 2021-11-25
  • 2021-09-08
  • 2021-11-14
  • 2021-09-08
  • 2021-09-08
  • 2021-09-08
  • 2021-11-21
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2021-12-05
  • 2021-09-08
  • 2021-10-22
相关资源
相似解决方案