Location: PHPKode > projects > pMH > pmh/src/user/actSendCode.php

$Header: /cvs/hol/src/user/actSendCode.php,v 1.3 2005/03/17 18:26:29 jakuza Exp $

<fusedoc fuse="actSendCode.php">

      Send an activation code to the declared user mail


      <history author="" date="2003 September 29" email="" type="create" />

         Data Rules: registrationData - (None)
         Data Rules: confirmationCode - MD5 hash;

         <string name="self" optional="false" />
         <structure name="registrationData" scope="request" optional="false" comment="User registration data form fields" />
         <string name="confirmationCode" scope="request" optional="false" comment="" />


$mail = new PHPMailer();

	case SMTP:
		$mail->IsSMTP(); # telling the class to use SMTP
		$mail->Host = $GLOBALS['CONFIG']['SMTP'];
	case PHPMAIL:
		$mail->IsMail(); # telling the class to use PHP mail() function

$mail->From = $GLOBALS['CONFIG']['MAILFROM'];
$mail->FromName = $GLOBALS['CONFIG']['APPNAME'];

# Build account activation URL
$url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?fuseaction='.$XFA[XFA_Activate].'&code='.$record['confirmcode'].'&username='.$record['username'].'&returnFuseaction='.$_SESSION['regData']['returnfa'];

$mail->Subject = $GLOBALS['language']['user']['codemailsubject'];
$mail->Body = sprintf($GLOBALS['language']['user']['codemail'], $_SESSION['regData']['firstname'], $url);
$mail->WordWrap = WRAP;

$fuseFailure = !$mail->Send();

if ($fuseFailure) die('Activation mail error');

# destroy data in session if it's all OK
if (!$_SESSION['regData']['returnFuseaction'])

Return current item: pMH