Sending e-mail not working

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 8488 Views - Last Post: 04 January 2013 - 01:00 PM Rate Topic: -----

#1 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Sending e-mail not working

Posted 03 January 2013 - 10:33 AM

I am new with PHP and MySQL. And for the sake of everything, I have been looking up tutorials to guide me step by step.

With the Registration system that requires the user to validate the email address - part 1 and Registration system that requires the user to validate the email address - part 2 tutorials, I am not getting an email to click the link to finish validating. I check the spam and nothing.

Though after I integrate 'Part 2', my redirect to the home page doesn't work and my url (going to call it {Doc Root}) becomes {Doc Root}?accesscheck=%2Fportfolio%2FPicIt2%2Fhome.php instead of /home.php

But I do check the database in phpMyAdmin, and all my fields are filled out. And I don't get any errors.

I am hoping for sending the guy that will be hosting this on his servers within the next 14 1/2 hours for him to test then the next few days I would be working on configuring what I need to his servers.

If anyone can assist in anyway, whether it is a link to a tutorial that works or can show me what to change from what David Powers has written. It would be appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Sending e-mail not working

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10658
  • View blog
  • Posts: 39,573
  • Joined: 27-December 08

Re: Sending e-mail not working

Posted 03 January 2013 - 01:35 PM

The tutorial looks dated, and it provides a number of poor programming practices such as mixing the HTML and PHP, as well as using the old-style mysql_*() family of functions. We have a basic login script tutorial, which shows you a basis of how to separate your content and code, and should get you going in the right direction. You should also use Prepared Statements like PDO or MySQLi in favor of the (near) deprecated mysql_*() family of functions. Hope this helps some!
Was This Post Helpful? 0
  • +
  • -

#3 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 03 January 2013 - 01:43 PM

Thats for logging in, I'm just trying to figure out the mail() function.

Right now I am trying to put the website out in closed beta. Then work on everything to secure it properly will be done at the same time. And even during open-beta too.

I am not saying it isn't helpful, it will be. Just one thing at a time.

Will look back on those links when I get to that point.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10658
  • View blog
  • Posts: 39,573
  • Joined: 27-December 08

Re: Sending e-mail not working

Posted 03 January 2013 - 01:47 PM

Quote

Thats for logging in

I realize that. It still is a good basis for the registration page.

Quote

I'm just trying to figure out the mail() function.

The mail() function returns a value. If the result is false, then the message wasn't sent to the server for delivery. Otherwise, the message was at least sent to the server to be delivered. There is no guarantee that the mail() function will deliver your message.
Was This Post Helpful? 0
  • +
  • -

#5 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 03 January 2013 - 02:03 PM

View Postmacosxnerd101, on 03 January 2013 - 02:47 PM, said:

There is no guarantee that the mail() function will deliver your message.


Then how does everyone else do it with a successful send?
Facebook, MeetMe, here (I think, been a user for nearly 4 years - I forgot), etc...

Plus I understand that if I get errors it won't send. But I have it detect for invalid strings or empty, and if that is true then I would get a message saying "Please check [the mentioned row]" instead of storing it in the database.
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10658
  • View blog
  • Posts: 39,573
  • Joined: 27-December 08

Re: Sending e-mail not working

Posted 04 January 2013 - 12:05 AM

What does mail() return? Let's start there.
Was This Post Helpful? 0
  • +
  • -

#7 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 04 January 2013 - 12:07 AM

Nothing at all. It doesn't produce an error message on the page, and it doesn't send an email in general... just nothing.
Was This Post Helpful? 0
  • +
  • -

#8 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10658
  • View blog
  • Posts: 39,573
  • Joined: 27-December 08

Re: Sending e-mail not working

Posted 04 January 2013 - 12:09 AM

And the error is...?

Also, if you could post your code along with it so we can track down based on the line numbers in the error messages as well.
Was This Post Helpful? 0
  • +
  • -

#9 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 04 January 2013 - 01:11 AM

macosxnerd101 May I send you the link in a private message that I have everything on?
I am only asking because it is far from being live, and I'd rather not have everyone swarm the website and only get disappointed because it isn't working. Just because there are people out there like that.

I AM NOT getting an error, and I AM NOT getting an email. I go into phpMyAdmin and check the database and see everything posted. If nothing posted, then I'd see an error instead of posted info.

If I PM you the link and you fill out the form, I will screenshot your db info and send it back to you for proof that I am not crazy.

I don't need the email working until the 1st of Feb, if I have no luck then I will just do a model box on the homepage that is an onload event that detects only if the user hasn't validated to click the link.
Was This Post Helpful? 0
  • +
  • -

#10 Anthonidas  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 218
  • Joined: 25-April 11

Re: Sending e-mail not working

Posted 04 January 2013 - 01:30 AM

Perhaps it is a stupid question BUT where are you testing your script? Is it a real server or is it just a testing environnement like XAMPP on your local computer?
Was This Post Helpful? 0
  • +
  • -

#11 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 04 January 2013 - 01:34 AM

Its on a real server.
Was This Post Helpful? 0
  • +
  • -

#12 Anthonidas  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 218
  • Joined: 25-April 11

Re: Sending e-mail not working

Posted 04 January 2013 - 01:44 AM

Ok, have you already tried a separate mail script, just to know if the mail-command works fine?

you could create a file called mail.php with following content:
<?PHP mail('myemail@address.xx', 'My Subject', 'myMessage'); ?>


and call the file. At least you know then if mail() works. Afterwards when you know that this works you start checking your script, to see if it contains any errors.
Was This Post Helpful? 0
  • +
  • -

#13 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10658
  • View blog
  • Posts: 39,573
  • Joined: 27-December 08

Re: Sending e-mail not working

Posted 04 January 2013 - 10:34 AM

Please don't PM me for help.

Again- what does mail() return.

$value = mail(/*your parameters*/);
if($value){
    //the message was sent to the server to be delivered
    //this does not guarantee the server delivered it
}

else{
    //message not sent to server
}


Was This Post Helpful? 0
  • +
  • -

#14 Viper2KX  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 195
  • Joined: 25-January 09

Re: Sending e-mail not working

Posted 04 January 2013 - 10:46 AM

It doesn't return anything. NOTHING.

Sorry for the all cap word, it doesn't give an output at all. NO error, NO email, nothing.

I asked to PM you for you to see for yourself, since you keep on asking me what it returns. IT returns nothing.
Was This Post Helpful? 0
  • +
  • -

#15 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9388
  • View blog
  • Posts: 35,245
  • Joined: 12-June 08

Re: Sending e-mail not working

Posted 04 January 2013 - 10:52 AM

That's just silly - it should return something. I mean the darn thing's has a boolean return type! Post your code here where you are calling it.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2