SN1P3R_85 Posted August 28, 2008 Share Posted August 28, 2008 hey everyone, I am fairly new with using php, and felt the need to have an email sent for something on my website. If the email was sent, I had it print "the email was sent successfully" on the screen. It does this every time I send the code, but when i check my inbox, there is no email in it. I then made a test file, to see if there was something wrong with my code. The test file contains this: <?php $to = "my_email@hotmail.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> I've ran this code several times, and havn't gotten an email . Every time I run it, I get the "Message successfully sent!", so I don't understand why I'm not recieving the email. Do any of you guys know what this might be? any help is appreciated. -SN1P3R_85 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 28, 2008 Share Posted August 28, 2008 are you using your own computer as a server, or are you using a server that is on the internet, such as a web host? Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 oh, i can't believe i left that out, My site is hosted on a webserver. Im pretty sure the mail() function is installed on it. Quote Link to comment Share on other sites More sharing options...
dezkit Posted August 28, 2008 Share Posted August 28, 2008 does your host use cpanel? Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 i am not sure. I am currently trying to get ahold of the server owner,(a friend of a friend kinda thing). Is there a way for me to check? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 28, 2008 Share Posted August 28, 2008 make sure you spelled your email correctly. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 ya, i checked it thoroughly. Its exact same. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 if any of u guys have a website or something, would u mind using my script, and inserting your email addresses, and telling me if it works. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 28, 2008 Share Posted August 28, 2008 Works on my server, must be your server. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 do any of you guys have any advice for what i should do? My knowledge of how PHP settings work, and even how to locate them is very small. I would appreciate any advice. What may seem obvious to you guys may have never even crossed my mind. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 28, 2008 Author Share Posted August 28, 2008 i got ahold of the guy. He won't let me use the mail() function for some stupid reason. Srry for wasting all your guy's time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.