runnerjp Posted November 22, 2007 Share Posted November 22, 2007 i belive the email script is correct as im getting no errors but im not reciving any of that email on my uni/website or hotmail account...is there something missing within the script or is this a common error on email servers side $getUser = "SELECT ID, Username, Email, Random_key FROM " . DBPREFIX . "users WHERE Username = " . $db->qstr ( $_POST['username'] ) . ""; if ( $db->RecordCount ( $getUser ) == 1 ) { $row = $db->getRow ( $getUser ); $subject = "Activation email from " . DOMAIN_NAME; $message = "Dear ".$row->Username.", this is your activation link to join our website. In order to confirm your membership please click on the following link: <a href=\"" . APPLICATION_URL . "confirm.php?ID=" . $row->ID . "&key=" . $row->Random_key . "\">" . APPLICATION_URL . "confirm.php?ID=" . $row->ID . "&key=" . $row->Random_key . "</a> <br /><br />Thank you for joining"; if ( send_email ( $subject, $row->Email, $message ) ) { $msg = 'Account registered. Please check your email for details on how to activate it.'; } Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 can you post your send_email function ? Quote Link to comment Share on other sites More sharing options...
runnerjp Posted November 22, 2007 Author Share Posted November 22, 2007 sorry that would have helped <?php // ------------------------------------------------------------------------ /** * send_email - Handles all emailing from one place * * @access public * @param string * @return bool TRUE/FALSE */ function send_email ( $subject, $to, $body ) { $mail->From = ADMIN_EMAIL; $mail->FromName = DOMAIN_NAME; $mail->AddAddress( $to ); $mail->AddReplyTo ( ADMIN_EMAIL, DOMAIN_NAME ); $mail->Subject = $subject; $mail->Body = $body; $mail->WordWrap = 100; $mail->IsHTML ( MAIL_IS_HTML ); $mail->AltBody = html2txt ( $body ); if ( ! $mail->Send() ) { if ( RUN_ON_DEVELOPMENT ) { echo $mail->ErrorInfo;//spit that bug out } return FALSE; } else { return TRUE; } } ?> Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 where is $mail coming from I do not see it being passed on initialized in the function, if its a global variable you have to put global $mail; in your function Quote Link to comment Share on other sites More sharing options...
runnerjp Posted November 22, 2007 Author Share Posted November 22, 2007 sorry could you explain more please little confuzed Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 your using some mail class where is a being created where is your $mail variable being made ? Quote Link to comment Share on other sites More sharing options...
runnerjp Posted November 22, 2007 Author Share Posted November 22, 2007 ahhh dam i havent added 1 yet pants... thats possibly where im going wrong... a very silly mistake thanks lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.