PHP - Sending Verification Email
I am sending a email verification that a person registers on my site. I have two problems. Here is the email script:
Code: [Select] $message = "Thank you for registering."; mail($email, 'Registration Confirmation', $message, 'From: noreply@website.com'); Problem 1: I have tried this on two different identical pages, index.php and register.php. It only works in the index page. Problem 2: When it does work on the index page, the From header does not show what is in the mail() function, it shows that it is from my host. What's up with that? Given the choice, I need to get problem 2 solved way more than problem 1. Thank you. Similar TutorialsHi, I'm new here and new to php. My first attempt at a php project actually so I'm hoping to get some help. I want people to register at my site but I don't want them to put false emails on it. So I used the coding from this website http://www.phpeasystep.com/workshopview.php?id=24 to provide codings for forms and email confirmation links. The process worked up to when I click on the confirmation link (at testing) from the email and the link returns to a blank webpage. No data is transferred from "temp_members_db" table to "registered_members" table at all. I'll attach print screen of my tables. Hoping that someone can point out to me where I'm going wrong as I can't seem to get myself out of this one. From our website we are connecting to GMAIL to send our emails through SMTP. For some reason it is not sending the emails to the CC or BCC email address event though GMAIL shows it was included in the email. Am I missing something in the below code? Code: [Select] $currentTime = time(); $emailTo = "redbrad0@domain.com"; $emailCC = "brad@domain.com"; $emailBCC = "events@domain.com"; $emailSubject = "TEST Email at (" . $currentTime . ")"; $emailBody = "This is the body of the email"; $headers = array(); if (!empty($emailTo)) $headers['TO'] = $emailTo; if (!empty($emailCC)) $headers['CC'] = $emailCC; if (!empty($emailBCC)) $headers['BCC'] = $emailBCC; if (!empty($emailSubject)) $headers['Subject'] = $emailSubject; $headers['From'] = "events@domain.com"; $mime = new Mail_mime("\n"); $mime->setTXTBody($emailBody); $body = $mime->get(); $headers = $mime->headers($headers); $mail = Mail::factory('smtp', array ('host' => 'ssl://smtp.gmail.com', 'auth' => true, 'port' => 465, 'username' => 'events@domain.com', 'password' => 'thepasswordhere')); try { $result = $mail->send($emailTo, $headers, $emailBody); } catch (TixException $ex) { echo "<font color=red>Error:" . $ex->getCode() . "</font><br>"; } echo "Emailed at (" . $currentTime . ")<br>"; die; function isValidEmail($email){ return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); } How do I incorporate the code above into my code?? Code: [Select] <?php error_reporting(E_ALL ^ E_NOTICE); ?> <?php // make sure the form has actually been submitted . . . if( strtolower($_SERVER['REQUEST_METHOD']) === 'post' ) { // 1. Create a database connection $connection = mysql_connect("localhost", "root", "maven777"); if(!$connection){ die("Database connection failed: " .mysql_error()); } // 2. Select a database to use $db_select = mysql_select_db("homesloans", $connection); if(!$db_select){ die("Database selection failed: " .mysql_error()); } $radius = ($_POST['radius']); $type = ($_POST['type']); $price = ($_POST['price']); $bedrooms = ($_POST['bedrooms']); $bathrooms = ($_POST['bathrooms']); $parking = ($_POST['parking']); $city = ($_POST['city']); $details = ($_POST['details']); $firstname = ($_POST['firstname']); $lastname = ($_POST['lastname']); $email = ($_POST['email']); $phone = ($_POST['phone']); $query="INSERT INTO leads (leadid, city, radius, type, price, bedrooms, bathrooms, parking, details, firstname, lastname, email, phone) VALUES('NULL', '[$city]', '[$radius]', '[$type]', '[$price]', '[$bedrooms]', '[$bathrooms]', '[$parking]', '[$details]', '[$firstname]', '[$lastname]', '[$email]', '[$phone]')"; mysql_query($query) or die ('Error updating database'); echo "Database Successfully Updated."; // not necessarily. The only way to know for sure is to check that mysql_affected_rows() > 0 } ?> Everything about the email is sending except the message text does anyone know what the issue could be? here is the block of code that sends the email Thanks in advance Code: [Select] $image = "http://www.visualrealityink.com/dev/clients/arzan/snell_form/images/email.png"; echo "got to process form"; $target_path = "upload/"; $path = $target_path = $target_path . basename( $_FILES['file']['name']); $boundary = '-----=' . md5( uniqid ( rand() ) ); $message .= "Content-Type: application/msword; name=\"my attachment\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment; filename=\"$path\"\n\n"; echo $path; $fp = fopen($path, 'r'); do //we loop until there is no data left { $data = fread($fp, 8192); if (strlen($data) == 0) break; $content .= $data; } while (true); $content_encode = chunk_split(base64_encode($content)); $message .= $content_encode . "\n"; $message .= "--" . $boundary . "\n"; $message .= $image . "<br />" . $_POST['name'] . "submitted a resume on our website. Please review the applications and contact the candidate if their resume is a fit for any open opportunities with the company. <br><br> Thank you. <br><br> SEI Team"; $headers = "From: \"Me\"<me@example.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\""; mail('george@visualrealityink.com', 'Email with attachment from PHP', $headers, $message); Hi the user fill details and then the email his sent to me the only problem is that the emails keeps going to my spam, can someone help me out please I looked already php website and email format looks the same. This is the link to my form. http://www.people.eurico.co.uk/ here my form script Code: [Select] <?php // Set email variables $email_to = 'xxxxx@xxxxxxx.co.uk'; $email_subject = 'Call back form'; // Set required fields $required_fields = array('fullname','email','telephone','comment'); // set error messages $error_messages = array( 'fullname' => 'Please enter a Name to proceed.', 'email' => 'Please enter a valid Email.', 'telephone' => 'Please telephone.', 'comment' => 'Please enter your Message to continue.' ); // Set form status $form_complete = FALSE; // configure validation array $validation = array(); // check form submittal if(!empty($_POST)) { // Sanitise POST array foreach($_POST as $key => $value) $_POST[$key] = remove_email_injection(trim($value)); // Loop into required fields and make sure they match our needs foreach($required_fields as $field) { // the field has been submitted? if(!array_key_exists($field, $_POST)) array_push($validation, $field); // check there is information in the field? if($_POST[$field] == '') array_push($validation, $field); // validate the email address supplied if($field == 'email') if(!validate_email_address($_POST[$field])) array_push($validation, $field); } // basic validation result if(count($validation) == 0) { // Prepare our content string $email_content = 'peoplesmartlearning.co.uk: ' . "\n\n"; // simple email content foreach($_POST as $key => $value) { if($key != 'submit') $email_content .= $key . ': ' . $value . "\n"; } // if validation passed ok then send the email mail($email_to, $email_subject, $email_content); // Update form switch $form_complete = TRUE; } } function validate_email_address($email = FALSE) { return (preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $email))? TRUE : FALSE; } function remove_email_injection($field = FALSE) { return (str_ireplace(array("\r", "\n", "%0a", "%0d", "Content-Type:", "bcc:","to:","cc:"), '', $field)); } ?> The HTML Code: [Select] <div class="call_us_form"> <p class="title">WE'LL CALL YOU BACK</p> <?php if($form_complete === FALSE): ?> <form class="contact_form" id="fm-form" method="post" action="index.php" > <fieldset> <div class="fm-req"> <label for="fm-firstname">Name</label> <input type="text" id="fullname" class="detail" name="fullname" value="<?php echo isset($_POST['fullname'])? $_POST['fullname'] : ''; ?>" /> <?php if(in_array('fullname', $validation)): ?><script type="text/javascript">alert("Please enter a Name"); history.back();</script><?php endif; ?> </div> <div class="fm-req"> <label for="fm-firstname">Email</label> <input type="text" id="email" class="detail" name="email" value=" <?php echo isset($_POST['email'])? $_POST['email'] : ''; ?>" /> <?php if(in_array('email', $validation)): ?><script type="text/javascript">alert("Please enter a valid Email Address"); history.back();</script><?php endif; ?> </div> <div class="fm-req"> <label for="fm-firstname">Number</label> <input type="text" id="telephone" class="detail" name="telephone" value="<?php echo isset($_POST['telephone'])? $_POST['telephone'] : ''; ?>" /> <?php if(in_array('telephone', $validation)): ?><script type="text/javascript">alert("Please enter telephone number"); history.back();</script><?php endif; ?> </div> <div class="fm-req"> <label for="fm-lastname">Message</label> <textarea cols="40" rows="5" id="comment" name="comment" class="mess"><?php echo isset($_POST['comment'])? $_POST['comment'] : ''; ?></textarea> <?php if(in_array('comment', $validation)): ?><script type="text/javascript">alert("Please enter your message"); history.back();</script><?php endif; ?> </div> <input class="submit_button" type="submit" value="Call us" /> </fieldset> </form> <?php else: ?> <p>Thank you for your Message!</p> <p>We will get back to you as soon as we can</p> <script type="text/javascript"> setTimeout ('ourRedirect()', 5000) function ourRedirect () { location.href='index.php' } </script> <?php endif; ?> Code: [Select] $sql="SELECT * FROM $tbl_name3 WHERE review_show='n'"; $result=mysql_query($sql); $num_results=mysql_num_rows($result); if($num_results > 1){ $message="You have ".$num_results." reviews unapproved."; mail('example@example.com','GHP Reviews', $message, 'From: example@example.com'); } $sql2="SELECT * FROM $tbl_name4 WHERE rma_issued='n'"; $result2=mysql_query($sql2); $num_results2=mysql_num_rows($result2); if($num_results2 > 1){ $message="You have ".$num_results2." RMA Numbers Requested."; mail('example@example.com','GHP RMA Number Requests', $message, 'From: example@example.com'); } The reviews email is being sent, however, the RMA email is not. EDIT: Nevermind, $num_results and $num_results2 should have been > 0 not > 1. Actually, what i want to do is to use the email to fetch the $email,$password and $randomnumber from database after I need some help over here. I want to send an email to my friends by checking the database and extract the id. After extracting the id from the database, i want to include a URL with the id. E.g. www.abc.php?35 (35 is the id) www.abc.php?40 (40 is the id) May I know how to send an email with multiple url? Is it using a for loop in the php email function? Your help is greatly appreciated. Hey guys, Coding something for a survey as no solution exists for our needs. I have not finished the code as I still need to do error checks + making it spam proof. Anyway I am not reciving the email even though it says that I have been sent it. Any suggestions are appreciated, please ask if you need additional info to be able to help, and thank you in advanced. Code: [Select] <?php error_reporting(0); if(isset($_POST['submit'])){ //Check that all fields that are mandatory are filled in and that the $Email variable is real $Title = $_POST['Title']; $FirstName = $_POST['FirstName']; $LastName = $_POST['LastName']; $Email= $_POST['Email']; $Country= $_POST['Country']; $State= $_POST['State']; $List= $_POST['List']; $Nav= $_POST['Nav']; $IssuesYes= $_POST['IssuesCheck']; $IssuesList= $_POST['IssuesList']; $Satisfaction= $_POST['Satisfaction']; $Improvement= $_POST['Improvement']; $ValueSatisfaction= $_POST['Value']; $Recommendation= $_POST['Recommend']; $Knowledge= $_POST['Knowledge']; $Comments= $_POST['Comments']; $Gender= $_POST['Gender']; $Age= $_POST['Age']; $Source= $_POST['Source']; $ContactNumber= $_POST['Contact']; $Newsletter= $_POST['Newsletter']; $errors = array(); //Check that the fields above are not empty: $to = "email@email.com";//Obviously not real one that I am sending to. $subject = "Survey Form Submission"; $from = $to; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $body = "$name submitted the survey form:\n". "This is what they responded with to each question: <br>". "Their Name: $Title $FirstName $LastName <br>"."Email: $Email <br>"."Country: $Country <br>"."State: $State<br>"."Bought: $List<br>"."Website Navigation: $Nav<br>"."Issues: $IssuesYes " ." $IssuesList"."Satisfaction: $Satisfaction<br>"."Improvement: $Improvement<br>"."Value Satisfaction: $ValueSatisfaction<br>"."Reccomend: $Recommendation<br>"."Knowledge: $Knowledge<br>"."Comments: $Comments <br>"."Gender: $Gender<br>"."Age: $Age <br>"."Source for Finding Us: $Source <br>"."Contact: $ContactNumber<br>"."Subscribe to Newsletter?: $Newsletter<br>"; $headers = "From: $from \r\n"; $headers .= "Reply-To: $visitor_email \r\n"; if( mail($to, $subject, $body,$headers)){ echo "Email Send!"; }else{ echo "Somethings wrong :\ "; } // header('Location: http://www.********/thank-you-for-survey'); } ?> Hi, I want to send an email to my registered users so that when they click on the URL given in the message hey should come back to my site as confirmetion of their registration. I am able to send the mail but the mail body is not coming as expected. Here's my code Code: [Select] <?php public function email($id){ //get users info $this->userInfo = $this->model->listUser($id); $this->sendEmail($this->userInfo); } public function sendEmail($data){ $to =$data['email']; $this->msg ="<img src=\"ideas.kpjit.com/public/images/header-img.jpg\" /> <h1>KPJ Idea</h1> <p>Make a difference</p> <p>This is a Confirmation Mail.Please confirm your registration by clicking here <a href=\"http://ideas.kpjit.com\register\confirm\ <?php echo $this->data['id'];?></p>\" "; $subject = "Registration confirmation"; $message = $this->msg; $from ="narjisfatima@yahoo.com"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From:narjisfatima@yahoo.com' . "\r\n"; if(mail($to,$subject,$headers)){ $this->render2("register/message"); exit; } } Also I am unable to insert my site banner in the mail. How can I do It. Hi Guys I am creating a site which allows the registration of new users. I already have my user registration page up and running which is lnked to my database. I would now like to add a function which will send a 'welcome to...' email to the email address provided on the registration form provided by the new user. Could anybody please point me in the right direction i.e where to start? I am using dreamweaver and Cpanel. Thanksin advance Hello Guys I just want to ask if I will send email using php syntax do I need to configure the php ini settings? Any ideas how to configure it? Your usual cooperation is highly appreaciated. God Bless.. Hi
I have below code :
<?php $_SERVER['SERVER_NAME']; $to = "info@domain.com"; $subject = "Test mail"; $body = $_SERVER['SERVER_NAME']; $from = "user@example.com"; $headers = "From:" . $from; mail($to, $subject, $body, $headers) ?>the email is sent correctly but without any body text . I use $_SERVER['SERVER_NAME']; but nothing show as body . I want to use this code load each day becuse I want to know which domain is used my script. but now the code not work. I am creating a forgotten password button, it works but it just doesn't send me an email containing the reset link.
Here's the code for the email part:
<?php require("../config.php"); if($_GET['code']) { $get_username = $_GET['username']; $get_code = $_GET['code']; $query = mysql_query("SELECT * FROM users WHERE username='$get_username'"); while($row = mysql_fetch_assoc($query)) { $db_code = $row['passreset']; $db_username = $row['username']; } if($get_username == $db_username && $get_code == $db_code) { echo " <form action='pass_reset_complete.php?code=$get_code' method='POST'> Enter a new password<br><input type='password' name='newpass'><br> Re-enter your password<br><input type='password' name='newpass1'><p> <input type='hidden' name='username' value='$db_username'> <input type='submit' value='Update Password!'> </form> "; } } if(!$_GET['code']) { echo " <form action='forgot_pass.php' method='POST'> Enter your username<br><input type='text' name='username'><p> Enter your email<br><input type='text' name='email'><p> <input type='submit' value='Submit' name='submit'> </form> "; if(isset($_POST['submit'])) { $username = $_POST['username']; $email = $_POST['email']; $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrow = mysql_num_rows($query); if($numrow!=0) { while($row = mysql_fetch_assoc($query)) { $db_email = $row['email']; } if($email == $db_email) { $code = rand(10000,1000000); $to = $db_email; $subject = "Password Reset"; $body = " This is an automated email. Please DO NOT reply to this email. Click the link below or paste it into your browser http:/www.***REMOVED***.com/second/forgot_pass.php?code=$code&username=$username "; mysql_query("UPDATE users SET passreset='$code' WHERE username='$username'"); mail($to,$subject,$body); echo "Check Your Email"; } else { echo "Email is incorrect"; } } else { echo "That username doesnt exist"; } } } ?> this is my email.php file <?php $senderName =$_POST['userName']; $senderEmail =$_POST['userEmail.']; $senderMessage =$_POST['userMessage.']; //security $senderName=stripslashes($userName); $senderEmail=stripslashes($userEmail); $senderMsg=stripslashes($userMessage); $to = 'myName@mydomain.com'; $from = 'myName@mydomain.com'; $subject = 'Testing CONTACT PAGE'; $message = 'Message From your site: Their Name: $senderName Their Email: $senderEmail Their Message is below: $senderMsg'; // Build $headers Variable $headers = 'From: Company <mysite@mydomain.com.com>' . "\r\n"; $to = '$to'; // Send the email mail($to, $subject, $message, $headers); $my_msg='thanks your message has been sent.'; print $my_msg; ?> The error I'm getting is this: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\PHP_Test\email.php on line 5 all I want to be able to do is verify my form works and that I can receive emails from users of mysite any help would be greatly appreciated. Also what should the send_mail in the PHP.INI file be set to? thansk this is a forgot password page and this email script will not send Code: [Select] <?php $emailcut = substr($email, 0, 4); // Takes first four characters from the user email address $randNum = rand(); $tempPass = "$emailcut$randNum"; $hashTempPass = md5($tempPass); @mysql_query("UPDATE myMembers SET password='$hashTempPass' where email='$email'") or die("cannot set your new password"); include('Mail.php'); include('Mail/mime.php'); // Constructing the email $sender = "Social network"; // Your email address $recipient = "$email"; // The Recipients name and email address $subject = "Reset Your Password"; // Subject for the email $text = 'This is a text message.'; // Text version of the email $html = "<html><body><div align=center><br>----------------------------- New Login Password --------------------------------<br><br><br> Your New Password for our site is: <font color=\"#006600\"><u>$tempPass</u></font><br><br /> </div></body></html>"; // HTML version of the email $crlf = "\n"; $headers = array( 'From' => $sender, 'Return-Path' => $sender, 'Subject' => $subject ); // Creating the Mime message $mime = new Mail_mime($crlf); // Setting the body of the email $mime->setTXTBody($text); $mime->setHTMLBody($html); // Add an attachment // Set body and headers ready for base mail class $body = $mime->get(); $headers = $mime->headers($headers); // SMTP authentication params $smtp_params["host"] = "smtp.gmail.com"; $smtp_params["port"] = "587"; $smtp_params["auth"] = true; $smtp_params["username"] = "activate.social@gmail.com"; $smtp_params["password"] = "pass"; // Sending the email using smtp $mail =& Mail::factory("smtp", $smtp_params); $result = $mail->send($recipient, $headers, $body); if (PEAR::isError($mail)) { $outputForUser = '<font color="#FF0000">Password Not Sent.<br /><br /> Please Contact Us...</font>'; } else { $outputForUser = "<font color=\"#006600\"><strong>Your New Login password has been emailed to you.</strong></font>"; } } } else { $outputForUser = 'Enter your email address into the field below.'; } ?> Can someone help me understand why an email isn't being sent after clicking submit? Code: [Select] <?php error_reporting(E_ALL); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php extract ($_POST); if(!isset($submit)) { ?> <form action=" " method="post" name="test"> Name: <input name="name " type="text" id="name " size="8" /><br /> phone <input name="phone" type="text" size="13" /><br /> email <input name="email" type="text" size="9" maxlength="30" /><br /> <input name="submit" type="submit" value="submit" /> </form> <?php $Recipient = "$email"; $MsgSubject = "message subject"; $MsgHeader = "From Auntie Vic's Treatery <auntievics@gmail.com>\r\n"; $MsgBody = "message body."; mail($Recipient, $MsgSubject, $MsgBody, $MsgHeader); } else { echo " thank you for your order. It is being processed. Thank you for your business."; } ?> </body> </html> Hi, I have done this script that sends emails without attachments. What I want to do now is add the functionality to attach multiple files using one single field, kind of what Outlook does...you can select one or more files to attach to your email. Any ideas how I can do this? Thanks Code: [Select] <?php $EmailTo = Trim(stripslashes($_POST['to'])); $Subject = Trim(stripslashes($_POST['subject'])); $email = Trim(stripslashes($_POST['email'])); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: My company<info@mycompany.com>' . "\r\n"; $headers .= "Cc: {$_POST['cc']}\r\n"; $headers .= "Bcc: {$_POST['bcc']}\r\n"; // prepare email body text $Body = ""; $Body .= $email; $Body .= "\n"; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, stripslashes($Body), $headers); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../PC_email_compose.php?emailsentok=true\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../PC_email_compose.php?emailsenterror=true\">"; } ?> Hi, I'm new to PHP and servers and wonder if its possible to send email from a PHP application that I created in Eclipse running on a MAC using MAMP. This would be done while connected on WiFi, lets say in a coffee shop. Thanx hi all, im working on a email send to de user who register on the website! now i get the email but its not email/html view and it gets in to the unwanted folder, also as i siad trust this emailadress! what do i wrong in the code?? the whole php file see //#### XXX ### where i need help! Code: [Select] <?php Session_start(); if(file_exists("support/functions_alg.php")) // user,pass and database file { include("support/functions_alg.php"); // database functions file } if($_REQUEST) { $email=$_REQUEST['email']; $pass=md5( $_REQUEST['pass'] ); $secc=md5( $_REQUEST['sec_code'] ); function check_code($secc) { if($secc == $_REQUEST['mdcode']) { return true; } else { return false; } } function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } if(check_email_address($email)) { if(check_code($secc)) { //$res=register($email,$pass,$name,$address,$huisnr,$zipcode,$plaats,$dob_year,$dob_month,$dob_date,$tel); $res=true; if($res==true) { // ##### XXX ##### //mail function /* subject */ $subject = "Activeer uw Profiel"; /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0 \r\n"; $headers .= "Content-type: text/html; charset=utf-8 \r\n"; /* additional headers */ $headers .= "From: " . $mailme . " \r\n"; /* and now mail it */ $text = ' <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://'.$_SERVER['SERVER_NAME'].'/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html>'; $res = mail($email,$subject,$text,$headers); echo("<script>document.location.href='index.php?topic=reg_result&".$res."'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'?topic=reg_result&true"'); //###### XXXX ####### } else { echo "<table border=1 class=outer_tbl align=center width=50% style='border-collapse:collapse;'>"; echo "<tr><td align=center>"; echo "Fout tijdens registratie<br><a href='javascript:history.back();'>Klik hier</a> om opnieuw te proberen"; echo "</tr></td></table>"; } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=code'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=code"'); } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=email'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=email"'); } } ?> the recived email looks like : Content-type: text/html; charset=utf-8 From: info@pc-hulp-online.nl Return-Path: anonymous@server70.hosting2go.nl X-OriginalArrivalTime: 30 Apr 2012 10:47:41.0985 (UTC) FILETIME=[AB19D110:01CD26BE] <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://nieuw.pc-hulp-online.nl/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html> please help me!! thnx, |