Jump to content

[SOLVED] not getting emails from email script


runnerjp

Recommended Posts

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.';
				}

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;
	}
} ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.