PHP Mail Help

I am a bit stuck. I wrote code for a members login page and after they register I want them to be able to get an email with their login info. I basically copied the info from a tutorial just changed up the info that was for my website.

Problem is I do not know how to set the mail function to use the smtp mail server.

Here is the section of code for the mail. any help on where or how to set the smtp up would be appreciated.

$to = ‘$memEmail’;
$subject = ‘Your Membership’;
$message = 'Dear $memFirstName $memSurName,
You are now registered at our website, !

To access your membership and character sheets, you will be able to login with the following information:
Username: $userName
Password: $userPassword
Please keep this username and password in a location that is easily accessible by you.


This is an automated response, please do not reply!’;
$headers = “From: [email protected]rn” .
‘X-Mailer: PHP/’ . phpversion() . “rn” .
“MIME-Version: 1.0rn” .
“Content-Type: text/html; charset=utf-8rn” .
“Content-Transfer-Encoding: 8bitrnrn”;

mail($to, $subject, $message, $headers)or die(‘something went wrong’);

Nevermind I found the error.

used single quotes instead of double quote.

Sponsor our Newsletter | Privacy Policy | Terms of Service