When sending mail in PHP its always best to use an SMTP server rather than the mail() function, and the ideal candidate for the job is PHPMailer.
Assuming you have an SMTP server (usually mail.yourdomain.com) and a username and password (to authenticate as some servers won't allow you to send via SMTP without it) sending mail with PHPMailer is easy as pie.
For websites that send lots of emails with different information it's a good idea to setup some email templates.
In this example we will create a folder called "email_templates" and will create a file called "register.html" which will contain the login information when someone registers to our site:
Now here is the code to send this as an email, assuming you have the username and password of the user signed up.