I'm running IIS & WAMP on my PC. The tutorial on installing WAMP says to change my port to 8080 (so I type http://localhost:8080 on my browser when I'm using PHP) to get both IIS & WAMP to work (which I've managed to do).
The problem is that I think (do correct me if I'm wrong) SMTP port 25 'belongs' to IIS because PHP mail refuses to work with this setting... There is nothing in the WAMP homepage about changing the SMTP port to some other value, though.
Help, anyone? Thank you.
WAMP question localhost set to 8080
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
I'd be willing to bet it's probably because you don't have an outgoing SMTP server defined (or defined properly) - the IIS mail server would still need to connect to another SMTP server to send the mail somewhere, and most ISPs block this traffic for spam reasons.
Try setting your ISP's SMTP server in php.ini
find:
and change to:
and see if that works..
alternatively, you can use ini_set() to set these at runtime:
Worked for me when I just tried it, but your mileage may vary.
Try setting your ISP's SMTP server in php.ini
find:
Code: Select all
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25Code: Select all
[mail function]
; For Win32 only.
SMTP = smtp.yourISP.com
smtp_port = 25alternatively, you can use ini_set() to set these at runtime:
Code: Select all
ini_set('sendmail_from','you@domain.com');
ini_set('SMTP','smtp.yourISP.com');
ini_set('smtp_port','25');
mail('test@domain.com', 'test subject', 'this is a test message!');