Mudsaf Posted May 28, 2012 Share Posted May 28, 2012 Im wondering how does this mail() function work. I got PHP script likewhile ($row = mysql_fetch_array($result2)) {mail($row['Sahkoposti'], 'New comment on websites', '$text');} 1. $row['Sahkoposti'] = Email2. 'Subject'3. text Im wondering does this email thing require SMTP service or some port open to work correctly. Link to comment Share on other sites More sharing options...
TheGallery Posted May 28, 2012 Share Posted May 28, 2012 I think all you have to do is open the default SMTP port (which is 25) in order to work. At least that's the error i am getting when trying to send emails from my localserver. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 28, 2012 Share Posted May 28, 2012 The settings for the mail function are in php.ini: http://www.php.net/manual/en/mail.configuration.php On Windows you can set it to use an SMTP server, otherwise it looks for the sendmail program. Link to comment Share on other sites More sharing options...
Mudsaf Posted May 29, 2012 Author Share Posted May 29, 2012 So how should i configure this? [mail function]; For Win32 only.; http://php.net/smtpSMTP = localhost (Keep this to localhost or public adress?); http://php.net/smtp-portsmtp_port = 25 (Open port 25 UDP?); For Win32 only.; http://php.net/sendmail-from;sendmail_from = me@example.comsendmail_from = [email="staff@MYSITE.COM"]staff@MYSITE.COM[/email] (Any email for example staff@mywebsite.com or does it have to be some real email adress); For Unix only. You may supply arguments as well (default: "sendmail -t -i").; http://php.net/sendmail-path;sendmail_path = (???) Link to comment Share on other sites More sharing options...
justsomeguy Posted May 29, 2012 Share Posted May 29, 2012 I don't know what kind of server you're using, if you have sendmail or an equivalent installed, or if you have a SMTP server available, so I can't say how to configure that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now