localhost & mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

localhost & mail()

Post by amirbwb »

hello i am using xampp, how can i send mails from localhost ... i'm creating the "forgot my password" function so i want to see if it's working :D:D thx
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: localhost & mail()

Post by Celauran »

You'll need to install a mail server or use something like PEAR's Mail package to use your ISP's SMTP server.
User avatar
Pazuzu156
Forum Contributor
Posts: 241
Joined: Sat Nov 20, 2010 9:00 pm
Location: GA, USA
Contact:

Re: localhost & mail()

Post by Pazuzu156 »

RoundCube is the best way to go for something like this. Also, you need a live SMTP host and IMAP host.
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: localhost & mail()

Post by amirbwb »

thanks for helping, look at what i've done:
-install xampp
-start Apache Mysql and Mercury
-open mercury and manage a new user "amir" (and set a username and password)
-open outlook express created a new account with email "amir@localhost" and incoming /outgoing server 127.0.0.1 or localhost
-but when i send a msg to "amir@localhost" it's telling me :
"The connection to the server has failed. Account 'Amir', Server '127.0.0.1',Protocol:SMTP, Port 25, Secure (SSL), No Socket Error: 10061, Error Number:0x800CCC0E"
User avatar
Pazuzu156
Forum Contributor
Posts: 241
Joined: Sat Nov 20, 2010 9:00 pm
Location: GA, USA
Contact:

Re: localhost & mail()

Post by Pazuzu156 »

If I've learned anything from web design, it's that anything you want to do on a home server for outside communications, ports must be forwarded. If you have ports forwarded, then use the STMP and IMAP provided by your ISP, use them and make a subdomain. Many people use "mail.domain.com" as a subdomain for their STMP and IMAP connections. STMP is for any outgoing messages and is the easiest to set up, use the STMP port from your ISP, forward that port. IMAP is for incomming messages and allows for people to send messages to your mail server. Use the IMAP port from your ISP and forward that as well, then forward port 80 so any outside connections can connect to you. After that, you shouldn't have any problems.
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
Post Reply