source-function-F_send_user_reg_email

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
Overview

Classes

Interfaces

Exceptions

Functions

  1: <?php
  2: //============================================================+
  3: // File name   : tce_functions_user_registration.php
  4: // Begin       : 2008-03-31
  5: // Last Update : 2011-05-20
  6: //
  7: // Description : Support functions for user registration.
  8: //
  9: // Author: Nicola Asuni
 10: //
 11: // (c) Copyright:
 12: //               Nicola Asuni
 13: //               Tecnick.com LTD
 14: //               www.tecnick.com
 15: //               info@tecnick.com
 16: //
 17: // License:
 18: //    Copyright (C) 2004-2010  Nicola Asuni - Tecnick.com LTD
 19: //    See LICENSE.TXT file for more information.
 20: //============================================================+
 21: 
 22: /**
 23:  * @file
 24:  * Support functions for user registration.
 25:  * @package com.tecnick.tcexam.shared
 26:  * @author Nicola Asuni
 27:  * @since 2003-03-31
 28:  */
 29: 
 30: /**
 31:  * Send a registration verification email to user.
 32:  * @param $user_id (int) User ID
 33:  * @param $user_email (string) User email
 34:  * @param $user_verifycode (string) user verification code
 35:  */
 36: function F_send_user_reg_email($user_id, $user_email, $user_verifycode)
 37: {
 38:     global $l, $db;
 39:     require_once('../config/tce_config.php');
 40:     require_once('../../shared/code/tce_class_mailer.php');
 41:     require_once('../../shared/config/tce_email_config.php');
 42:     require_once('../../shared/config/tce_user_registration.php');
 43:     require_once('../../shared/code/tce_functions_html2txt.php');
 44: 
 45:     $user_id = intval($user_id);
 46: 
 47:     // Instantiate C_mailer class
 48:     $mail = new C_mailer;
 49: 
 50:     //Load default values
 51:     $mail->setLanguageData($l);
 52:     $mail->Priority = $emailcfg['Priority'];
 53:     $mail->ContentType = $emailcfg['ContentType'];
 54:     $mail->Encoding = $emailcfg['Encoding'];
 55:     $mail->WordWrap = $emailcfg['WordWrap'];
 56:     $mail->Mailer = $emailcfg['Mailer'];
 57:     $mail->Sendmail = $emailcfg['Sendmail'];
 58:     $mail->UseMSMailHeaders = $emailcfg['UseMSMailHeaders'];
 59:     $mail->Host = $emailcfg['Host'];
 60:     $mail->Port = $emailcfg['Port'];
 61:     $mail->Helo = $emailcfg['Helo'];
 62:     $mail->SMTPAuth = $emailcfg['SMTPAuth'];
 63:     $mail->SMTPSecure = $emailcfg['SMTPSecure'];
 64:     $mail->Username = $emailcfg['Username'];
 65:     $mail->Password = $emailcfg['Password'];
 66:     $mail->Timeout = $emailcfg['Timeout'];
 67:     $mail->SMTPDebug = $emailcfg['SMTPDebug'];
 68:     $mail->PluginDir = $emailcfg['PluginDir'];
 69:     $mail->Sender = $emailcfg['Sender'];
 70:     $mail->From = $emailcfg['From'];
 71:     $mail->FromName = $emailcfg['FromName'];
 72:     if ($emailcfg['Reply']) {
 73:         $mail->AddReplyTo($emailcfg['Reply'], $emailcfg['ReplyName']);
 74:     }
 75: 
 76:     $mail->CharSet = $l['a_meta_charset'];
 77:     if (!$mail->CharSet) {
 78:         $mail->CharSet = $emailcfg['CharSet'];
 79:     }
 80: 
 81:     $mail->Subject = $l['w_registration_verification'];
 82:     $mail->Body = $l['m_email_registration'];
 83: 
 84:     $mail->IsHTML(true); // Sets message type to HTML.
 85: 
 86:     //$userverifycode
 87:     //compose confirmation URL
 88:     $subscribe_url = ''.K_PATH_PUBLIC_CODE.'tce_user_verification.php?a='.$user_email.'&amp;b='.$user_verifycode.'&amp;c='.$user_id.'';
 89: 
 90:     //--- Elaborate Templates ---
 91:     $mail->Body = str_replace('#EMAIL#', $user_email, $mail->Body);
 92:     $mail->Body = str_replace('#USERIP#', $_SERVER['REMOTE_ADDR'], $mail->Body);
 93:     $mail->Body = str_replace('#SUBSCRIBEURL#', $subscribe_url, $mail->Body);
 94:     $mail->Body = str_replace('#TCEXAMURL#', K_PATH_HOST.K_PATH_TCEXAM, $mail->Body);
 95: 
 96:     //compose alternative TEXT message body
 97:     $mail->AltBody = F_html_to_text($mail->Body, false, true);
 98: 
 99:     $mail->AddAddress($user_email, ''); //Adds a "To" address
100:     if (strlen(K_USRREG_ADMIN_EMAIL) > 0) {
101:         // add administrator to BCC field
102:         $mail->AddBCC(K_USRREG_ADMIN_EMAIL);
103:     }
104:     if (!$mail->Send()) { //send email to user
105:         F_print_error('ERROR', 'EMAIL ERROR');
106:     }
107: 
108:     $mail->ClearAddresses(); // Clear all addresses for next loop
109:     $mail->ClearCustomHeaders(); // Clears all custom headers
110:     $mail->ClearAllRecipients(); // Clears all recipients assigned in the TO, CC and BCC
111:     $mail->ClearAttachments(); // Clears all previously set filesystem, string, and binary attachments
112:     $mail->ClearReplyTos(); // Clears all recipients assigned in the ReplyTo array
113: }
114: 
115: //============================================================+
116: // END OF FILE
117: //============================================================+
118: 
 

© 2004-2018 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy