Jump to content
  • Advertisement
Sign in to follow this  
ff8

php proplem

This topic is 5060 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 !

Share this post


Link to post
Share on other sites
Advertisement
It might help if you showed us sendmail.php. I'm having trouble getting to your C drive.[wink]

Share this post


Link to post
Share on other sites

.....
$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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Use if to validate the send, like:

.....
$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.

Share this post


Link to post
Share on other sites
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???

Share this post


Link to post
Share on other sites
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 :(:(:(:(

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
i am using my pc as host for me ,.. i opend 25 port from my dsl router from Virtual server for my ip 192.168.8.2 i change the stmp server from localhost to 192.168.8.2 but the same thing (i change it in php.ini)
i wonder why?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!