I want to develop a user's registration system for the users of my own site. For this purpose, when a user fill-up and being inserted successfully into the database, a authentication email has to be send to the email address provided by the user. I used php mail() function for this purpose like as below:
Code: Select all
$email = $_POST['email']; //suppose the email is user@yahoo.com
$headers = "From: personal_mail@yahoo.com";
$subject = "Authentication mail from mysite.com";
$message = "Dear User, Click on the link or open it in your browser to complete........................blah blah blah";
mail($email,$subject,$message,$headers);but the mail was delivered to another user who had user@gmail.com. So I think I should use a different address as sender.
Now my question is what should I use as sender email address and how yahoo can identify it? should I use webmaster@mysite.com as sender? If so, should the email address be registered in my site's email management system such as webmaster@mysite.com? If my webhosting company does not support email account openning then what should I do? what should I use as sender in that cases to send mail successfully to all email addresses?
Regards.