dragonking6v Posted March 4, 2006 Share Posted March 4, 2006 WARNING-I tried to be thorough, but you may be able to understand what I'm saying without having to read all thisI'm using php 5 and apache 1.3.31 I think. Anyway I bought a php book to help me learn this faster, and I've installed php mysql and apache exactly as they said and I have tested each one and each is working as it should.[code]<?php $to = "[email protected]"; $sub = "SUBJECT"; $msg = "This is where my message goes..."; $mail = mail ( $to, $sub, $msg ) or die( "Sorry - Didn't work right"); echo("It worked");?>[/code]I wrote this using an example from the book. The format for the mail fuction is:mail( to, subject, message );Now heres what I don't get. When I try localhost/mail.php (where it is saved) I get the die message.So, I try running it through the php editor that I am using, i.e. PHP Designer 2006. It tells me to check the settings for SMTP and smtp_port in php.iniI open up php.ini in the WINDOWS folder and here's what I have for SMTP and smtp_port:SMTP = localhostsmtp_port = 25Note that neither of these have a semi-colon in front of them (which would exclude them).Another thing that raised a red flag in my mind is in my debug preferences in PHP Designer It has a little box that says localhost (I believe) and then next to it it says portUnder localhost I put the correct location for the apache htdocs folder and under port it automatically put 80 in their. I'm not sure if this should be 25 like my smtp_port setting is or whatever.Anyway in I round-about way I would just like to know if smtp_port = 25 is ok, or if there is a way to check which port I should use. Also should my settings in debug mode in PHP Designer be 25, 80, or something else?Thanks a lot for your time :-D Link to comment https://forums.phpfreaks.com/topic/4054-php-mail-function-and-which-ports-to-use/ Share on other sites More sharing options...
zq29 Posted March 5, 2006 Share Posted March 5, 2006 I think a better question would be, do you have a mail server installed on your system. As SMTP is pointing at localhost, I would assume it is looking for a mailserver on your local machine to send the email through... If not, install one or point it to a mail server online somewhere. Link to comment https://forums.phpfreaks.com/topic/4054-php-mail-function-and-which-ports-to-use/#findComment-14357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.