drob50257447 2009-05-03 21:35
浏览 56
已采纳

如何从严重防火墙的网络发送带有PHP的电子邮件?

I wish to send an email from my localhost machine (using PHPs mail function) but I can not do this since I don't have a mail server. In addition, I need to be able to send emails through a network that is heavily firewalled (to what extent I do not know yet).

My idea is to make use of "QK SMTP Server 3" and get that to use an external server I have as a "Relay server". Will this work? Is there an easier option?

If my approach is Ok. I would like to know how I can open port 25 on my server so it can receive this request. By executing this command I get:

[root@balder296 ~]# service iptables status
Firewall is stopped.
[root@balder296 ~]#

Thank you for any help and advice.

Solved

Hotmail (surprisingly) provides a free relay service. I hope this works for me when I test this! But an external mail server is the way to go.

  • 写回答

6条回答 默认 最新

  • drrkgbm6851 2009-05-03 22:59
    关注

    Figure out if you can connect to the Internet on port 25 (SMTP)

    • telnet gmail-smtp-in.l.google.com 25 (this is one of the Gmail servers)

    If you're able to open up a connection, you can simply install a mail-server and use the mail() function to send messages.

    • yum install postfix (for example, from your 'service' remark I assume you're running Redhat or Centos)

    If you're unable to connect to Internet mail servers on port 25, you can try finding an internal mail relay (this is something you will have to find yourself, depending on your network).

    At that point you have two options. You can use the internal mail() function with your local mail server if you define the 'relay' parameter in your mails-server (/etc/postfix if you're using Postfix).

    The other option is to follow this guide and get get PHP to send the messages to an internal relay.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?