• Liunx php函数 smtp 发送邮件


    1. 查看防火墙是否开放端口 默认smtp 25

    iptables -L -n 
    如果没有,添加25端口
    iptables -A INPUT -p tcp --dport 25 -j ACCEPT
    iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT
    保存修改 /etc/rc.d/init.d/iptables save

    重启 service iptables restart
    查看防火墙状态   service iptables status
    
    

    2.查看服务器端口是否被占用

    netstat -tnlp

    25端口被占用,查看哪个程序在占用

    ps -f -p 1419

    postfix是一款运行在Linux环境下免费的邮件服务器,或者称为MTA(Mail Transfer Agent),其它类似的有Sendmail、Qmail、exim及Zmailer 等。所以Postfix就是一个搭邮件服务器的。那这玩意肯定是冲突了,我们要通过25端口请求外部的邮件服务器,而本地用25端口运行了一个邮件服务器,把25端口的postfix服务器杀掉, 执行kill 1419(当前postfix的PID)。

    检查postfix服务的状态 ,如果提示 master dead but pid file exists ,停掉 postfix 服务

    service postfix status
    service postfix stop

     检查一下是否有设定 postfix 在 reboot 后自动启动

      chkconfig --list | grep postfix

      chkconfig postfix off

    3.查看ipv6  :ip -6 addr show

    如果是用ipv6 连接的 改成ipv4

    eth0 (默认是第一个网卡)

    vim /etc/sysconfig/network-scripts/ifcfg-enoXXX 

    4. 刷新dns 

    Windows系统:
      开始——>运行——>输入 cmd 并回车
      在打开的命令行窗口,输入 ipconfig /flushdns
      你的Windows DNS 缓存已经得到刷新。
    Linux系统
      /etc/init.d/nscd restart
    Mac OS X苹果系统
      在命令行窗口(terminal)输入 lookupd -flushcache
      命令执行完毕,你的DNS缓存就得到了更新。
      较新的苹果Mac OS X系统应该使用下面的命令:
      type dscacheutil -flushcache

     5.查看php 相关配置

      扩展开启: sockets   openssl 

      函数启用: fsockopen 

      配置设置:allow_url_fopen =on

    6. 服务器-->安全组-->管理规则--->入网 、出网 放行 发送邮件的端口

  • 相关阅读:
    FAL_CLIENT和FAL_SERVER参数详解
    Goldengate OGG常见问题与错误列表
    Goldengate:ERROR 180 encountered commit SCN that is not greater than the highest SCN already processed
    OGG-01028 Incompatible Record解决办法
    goldengate–使用filter+@GETENV在线重新初始化指定的table
    RAC环境中threads变更后如何确保goldengate继续正常复制
    default listener is not configured in grid infrastructure home
    11gr2 RAC安装INS-35354问题一例
    为11.2.0.2 Grid Infrastructure添加节点
    修改/dev/shm的大小
  • 原文地址:https://www.cnblogs.com/xuey/p/7660143.html
Copyright © 2020-2023  润新知