Page 1 of 1

Sending Verification Email

Posted: Mon Mar 12, 2012 11:11 pm
by akrohn
I am trying to send an email to a person who registers on my site. I have two problems. First, here is the email script:

Code: Select all

        $message = "Thank you for registering.\n\n";
        mail($email, 'Registration Confirmation', $message, 'From: noreply@website.com');
Problem 1: I tried this on two identical pages, index.php and register.php. For some reason it only works on the index.php page.

Problem 2: When it does work on the index.php page, the From header does not show noreply@website.com, it shows that it is from my host. How can I fix that?

Thanks.

Re: Sending Verification Email

Posted: Tue Mar 13, 2012 2:55 am
by social_experiment
http://php.net/manual/en/function.mail.php
Have a look at the mail() function. Regarding the second problem you could contact your hosting provider; please paste all the code for the two page; if the register page isn't working other code could be causing a problem stopping the execution of the script before reaching the part where the mail should be sent