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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.