Re: Configure for mail relay
As far as I can tell from php.net and mail() function it cannot use SMTP relay that requires authentication. I googled around a bit and ended up hacking the file tiki-register.php to use sourceforge's PHPmailer class (class.phpmailer.php and class.smtp.php).
I need to clean up a bit more but it looks something like this:
excerpt for tiki-regsiter.php:

Copy to clipboard
if($validateUsers == 'y' and $email_valid != 'no') { //$apass = addslashes(substr(md5($tikilib->genPass()),0,25)); $apass = addslashes(md5($tikilib->genPass())); $foo = parse_url($_SERVER["REQUEST_URI"]); $foo1=str_replace("tiki-register","tiki-login_validate",$foo["path"]); $machine =httpPrefix().$foo1; $userlib->add_user($_REQUEST["name"],$apass,$_REQUEST["email"],$_REQUEST["pass"]); $emails = $notificationlib->get_mail_events('user_registers','*'); foreach($emails as $email) { $smarty->assign('mail_user',$_REQUEST["name"]); $smarty->assign('mail_date',date("U")); $smarty->assign('mail_site',$_SERVER["SERVER_NAME"]); $mail_data = $smarty->fetch('mail/new_user_notification.tpl'); //mail($email, tra('New user registration'),$mail_data,"From: $sender_email\r\nContent-type: text/plain;charset=utf-8\r\n"); } // Send the mail $smarty->assign('msg',tra('You will receive an email with information to login for the first time into this site')); $smarty->assign('mail_machine',$machine); $smarty->assign('mail_site',$_SERVER["SERVER_NAME"]); $smarty->assign('mail_user',$_REQUEST["name"]); $smarty->assign('mail_apass',$apass); $mail_data = $smarty->fetch('mail/user_validation_mail.tpl'); // Hack in PHPmailer function so that we can support SMTP Authentication require("class.phpmailer.php"); require("includes/config.inc"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = OV_SMTPhost; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = OV_SMTPuser; // SMTP username $mail->Password = OV_SMTPpassword; // SMTP password $mail->From = OV_SMTPfrom; $mail->FromName = OV_SMTPfromname; $mail->AddAddress ($_REQUEST["email"]); $mail->AddReplyTo (OV_SMTPaddreplyto); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = OV_SMTPsubject; $mail->Body = $mail_data; if(!$mail->Send()) { echo "Message was not sent "; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Message has been sent"; // end of PHPmailer Hack //mail($_REQUEST["email"], tra('Your Tiki information registration'),$mail_data,"From: $sender_email\r\nContent-type: text/plain;charset=utf-8\r\n"); $smarty->assign('showmsg','y'); } elseif ($email_valid != 'no') { $userlib->add_user($_REQUEST["name"],$_REQUEST["pass"],$_REQUEST["email"],''); $smarty->assign('msg',tra("Thank you for you registration. You may log in now.")); $smarty->assign('showmsg','y'); } }
where the OV_SMTP constants are defines for my ISP's SMTP requirements that i have in the includes/config.inc file.
Seems to work fine now.