Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SSJCORY

PHP error help

This topic is 5214 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

The error is:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\program files\easyphp1-7\www\sendmail.php on line 4
I have two files one called index.html and one called sendmail.php The index.html file has a form with a spot for an email and a message. And in sendmail.php it is supposed to send a email to me. With the email and message. Please helpa noob out. I just got this code from a website tutorial. I used easyphp to install php apache and mysql. So when i'm running the page i'm using the local web button on the taskbar when i right click the easyphp icon.
Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
[edited by - ssjcory on May 7, 2004 3:31:14 PM]

Share this post


Link to post
Share on other sites
Advertisement
The server probably isn''t configured to send e-mail.
Please show the code - so we can confirm that.

-Nik

Share this post


Link to post
Share on other sites
Read the PHP manual for the mail function.

On win32 the mail function uses SMTP, it requires you to have a mail relay running somewhere. localhost by default. It''s configured in php.ini.

Mark

Share this post


Link to post
Share on other sites
Here''s the code for the first file:

<html>
<body>
<FORM METHOD="post" ACTION="sendmail.php">
Email:<input name = "email" type = "text" /><br />
Message:<br/>
<textarea name ="message" rows="15" cols="40">
</textarea><br/>
<input type="submit" />
</FORM>
</body>
</html>

and for the second one...

<?
$email = $_REQUEST[''email''];
$message = $_REQUEST[''message''];
mail("ssjcoryfisher@hotmail.com","Feedback form results",$message,"From:$email");
?>

K thanks



Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don''t need you!|Sloth: Hey you guys!|

Share this post


Link to post
Share on other sites
Local host? Can someone tell me what to change to get email to work?




Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don''t need you!|Sloth: Hey you guys!|

Share this post


Link to post
Share on other sites
quote:
Original post by SSJCORY
Local host? Can someone tell me what to change to get email to work?



Edit: Sorry, temporary braindeath.

Your hosting provider should have this set up properly, so if you are uploading a script to a remote web server, it should work automagically.

To make it work on your development system, change the SMTP value in your PHP.ini to the name of your ISP's SMTP server.


[edited by - tylerk on May 7, 2004 5:28:30 PM]

Share this post


Link to post
Share on other sites
How do i know what my isps smpt server is? And what does smpt stand for? I am on bellsouth dsl. If that helps.



Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don''t need you!|Sloth: Hey you guys!|

Share this post


Link to post
Share on other sites
Hang on,

you have installed the Apache server on your own computer right?

If so your ISP has nothing to do with it.

SMTP stands for "Simple Mail Transfer Protocol", it''s how e-mail is sent.

Again, this is assuming you have Apache installed on your own computer. Find the file called php.ini, and open it up. Go to line 474 and you should see:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

If either the SMTP line or sendmail_from line has nothing after the equals, type in what I''ve shown above.

If they are both filled in let me know, and I''ll see if I can find any settings in the Apache config to fix your problem. Can''t look now though, girlfriend getting angry, wants to go out.

Share this post


Link to post
Share on other sites
Yeah they are both filled in exactly how you said they were.



Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don''t need you!|Sloth: Hey you guys!|

Share this post


Link to post
Share on other sites
Sorry I wasn''t thinking straight when I posted that.

I realised as soon as I left that I recently reinstalled Apache/PHP, so I posted the default configuration (which doesn''t work).

Umm, I''ll try to get it to work now then post again.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!