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.
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.