php proplem
hi all i make a small server for me and i make it support php i make listmail script and i use mail() function i face this problem ??
Warning: Failed to Connect in C:\apache\htdocs\listmail_new\admin\sendmail.php on line 9
#has been sent to srmo_13@hotmail.com
why??
bye !
..... $from="FROM: <".$from2.">"; while($row=mysql_fetch_array($r)){ mail($row['mail'],$sub,$body,$from); echo"#has been sent to ".$row['mail']."<BR>"; }.....
do you think from the code :S?
i test it before i another server and it's work allright
You're trying to use "mail()" in your computer?
Open your "php.ini" and find "[mail function]"
Change the line:
SMTP = localhost
putting a valid SMTP server.
Save and restart the server.
Open your "php.ini" and find "[mail function]"
Change the line:
SMTP = localhost
putting a valid SMTP server.
Save and restart the server.
Use if to validate the send, like:
The "@" in front of the function will not print PHP errors messages.
..... $from="FROM: <".$from2.">"; while($row=mysql_fetch_array($r)){ if(@mail($row['mail'],$sub,$body,$from)) echo "#has been sent to ".$row['mail']."<BR>"; else echo "#error while sending to ".$row['mail']."<BR>"; }.....
The "@" in front of the function will not print PHP errors messages.
thanks for your answer :):):)
but what you mean from
"SMTP = localhost
putting a valid SMTP server"
i open php.ini and find this line
SMTP = localhost
change it to what???
but what you mean from
"SMTP = localhost
putting a valid SMTP server"
i open php.ini and find this line
SMTP = localhost
change it to what???
hello the problem gone but i dont know why when i try to send the loop stop just in 30 email and it can not send email :(:(:(:(
Quote:Original post by ff8
thanks for your answer :):):)
but what you mean from
"SMTP = localhost
putting a valid SMTP server"
i open php.ini and find this line
SMTP = localhost
change it to what???
Change it to an SMTP server address. An SMTP server is an email sending server (as opposed to, say, a POP3 server which is used to collect messages). Unless you have an email server on localhost, you're not going to get very far.
How is your site hosted?
For example, I'm hosted on ActiveISP, and my POP3 is popmail.activeisp.com and my SMTP is smtpmail.activeisp.com
Check your hosting; see if they mention anything.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement