http://quiz.vanarts.com

login

When clicking "Don't have a login? Create an account" and filling out the form and click ADD button, SMTP error occurs.

account

Solution:

PHP mailer
1. make user that IIS supports php function

http://localhost/test.php

test.php

<?php  phpinfo();  ?>

2. copy class.phpmailer.php,class.pop3.php, and class.smtp.php from TCExam\shared\phpmailer directory into the website's homedirectory

PHP

3.
Because a static IP address is assigned from Shawcable, I could use the port 25 directly.
Save the following code to a.php file and test it.

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "shawmail.vc.shawcable.net";
$mail->SMTPAuth = false;
$mail->AddAddress("kaiming.liao@gmail.com");
$mail->AddAddress("kmliao@hotmail.com");
$mail->Subject = "Test 1";
$mail->Body = "Test 1 of PHPMailer.";
$mail->From="kaiming@vanarts.com";
$mail->FromName="mailer test";
$mail->Sender="kaiming@vanarts.com";
$mail->AddReplyTo("kaiming@vanarts.com","Replies for my site");
$mail->AddAttachment('c:\nic.bmp');
if(!$mail->Send())
{
echo "Error sending: " . $mail->ErrorInfo;;
}
else
{
echo "Letter is sent";
}?>


Confirmation email can be sent out.


4. POP before SMTP Authentication

<?php
require("class.pop3.php");
$pop = new pop3();
$pop->Authorise('mail.vanarts.com',110,30,'kaiming@vanarts.com','password',1);
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.vanarts.com";
$mail->SMTPAuth = false;
$mail->AddAddress("kaiming.liao@gmail.com");
$mail->AddAddress("kmliao@hotmail.com");
$mail->Subject = "Test 1";
$mail->Body = "Test 1 of PHPMailer.";
$mail->From="kaiming@vanarts.com";
$mail->FromName="mailer test";
$mail->Sender="kaiming@vanarts.com";
$mail->AddReplyTo("kaiming@vanarts.com","Replies for my site");

if(!$mail->Send())
{
echo "Error sending: " . $mail->ErrorInfo;;
}
else
{
echo "Letter is sent";
}?>


Confirmation message can be sent out.

Who sends the message out?

tce_email_config.php

<?php
//============================================================+
// File name   : cp_email_config.php
// Begin       : 2001-10-20
// Last Update : 2009-11-05
//
// Description : Default values for public variables of
//                                                            C_mailer class
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Nicola Asuni
//               Tecnick.com S.r.l.
//               Via della Pace, 11
//               09044 Quartucciu (CA)
//               ITALY
//               www.tecnick.com
//               info@tecnick.com
//============================================================+

/**
* @file
* Email configuration file.
* @package com.tecnick.tcexam.shared.cfg
* @author Nicola Asuni
* @since 2005-02-24
*/

/**
*/

// Email priority (1 = High, 3 = Normal, 5 = Low). Default value is 3.
$emailcfg['Priority'] = 3;

// Sets the CharSet of the message. Default value is 'iso-8859-1'.
$emailcfg['CharSet'] = 'UTF-8';

// Sets the Content-type of the message. Default value is 'text/plain'.
$emailcfg['ContentType'] = 'text/plain';

// Sets the Encoding of the message. Options for this are '8bit' (default), '7bit', 'binary', 'base64', and 'quoted-printable'.
$emailcfg['Encoding'] = '8bit';

// Sets the Encoding of the attachments. Default value is 'base64'
$emailcfg['AttachmentsEncoding'] = 'base64';

// Sets the default Administrator email. The join requests and confirmations will be sent to this address.
$emailcfg['AdminEmail'] = '';

// Sets the From email address for the message. Default value is 'root@localhost'.
$emailcfg['From'] ='testmail@vanarts.com';               

// Sets the From name of the message. Default value is 'Root User'.
$emailcfg['FromName'] = 'TCExam';

// Sets the Sender email of the message. If not empty, will be sent via -f to sendmail * or as 'MAIL FROM' in smtp mode. Default value is ''.
$emailcfg['Sender'] ='testmail@vanarts.com';

// Sets 'Reply-To' address.
$emailcfg['Reply'] ='testmail@vanarts.com';

// Sets 'Reply-To' name.
$emailcfg['ReplyName'] = 'testmail';

// Sets word wrapping on the message. Default value is false (off).
$emailcfg['WordWrap'] = false;

// Method to send mail: ('mail', 'sendmail', or 'smtp').
$emailcfg['Mailer'] = 'smtp';

// Sets the path of the sendmail program. Default value is '/usr/sbin/sendmail'.
$emailcfg['Sendmail'] = '/usr/sbin/sendmail';

// Turns Microsoft mail client headers on and off. Default value is false (off).
$emailcfg['UseMSMailHeaders'] = false;

// Sets default value for Header of messages.
$emailcfg['MsgHeader'] = "
<"."?xml version=\"1.0\" encoding=\"#CHARSET#\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"#LANG#\" lang=\"#LANG#\" dir=\"#LANGDIR#\">
<body>
";

//Sets default value for Footer of messages.
$emailcfg['MsgFooter'] = '</body></html>';

// -----------------------------------------------------------------------------
// --- SMTP VARIABLES ----------------------------------------------------------
// -----------------------------------------------------------------------------

// Sets the SMTP hosts. All hosts must be separated by a semicolon (e.g. Host("smtp1.domain.com;smtp2.domain.com"). Hosts will be tried in order.
$emailcfg['Host'] = 'shawmail.vc.shawcable.net';

// Sets the SMTP server port. Default value is 25.
$emailcfg['Port'] = 25;

// Default value is 'localhost.localdomain'.
$emailcfg['Helo'] = 'http://quiz.vanarts.com';

// Sets SMTP authentication. Remember to set the Username and Password. Default value is false (off).
$emailcfg['SMTPAuth'] = false;

// Sets the prefix to the server. Options are '', 'ssl' or 'tls'.
//$emailcfg['SMTPSecure'] = 'ssl';

// Sets SMTP username. Default value is ''.
$emailcfg['Username'] = '';

// Sets SMTP password. Default value is ''.
$emailcfg['Password'] = '';

// Sets the SMTP server timeout in seconds.
$emailcfg['Timeout'] = 10;

// Sets SMTP class debugging on or off. Default value is false (off).
$emailcfg['SMTPDebug'] = false;

// Sets plugins directory path
$emailcfg['PluginDir'] = '../../shared/phpmailer/';

//============================================================+
// END OF FILE
//============================================================+


What configuration controls the regular user to register a login?

tce_user_registration.php

login

 

The following settings will enable a regular user to register without confirmation message.

define ('K_USRREG_ENABLED',true);

define ('K_USRREG_EMAIL_CONFIRM',false);

The following setting will disable a regular user to register a login.

define ('K_USRREG_ENABLED',false);

 

Remember: admin can create a login without confiirmation anyway.