logo

Member
Member
Offline Offline
Posts: 13
Em@il Activation

hi i've set my site to do email activation
filled in email as mine unionjack@the9ers.co.uk
type to smtp
host to the host name which  from mywebsite host
username and password as my email but emails not going out
what am i doing wrong ?


eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

During installation, did it say fsockopen "passed" in green??

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

yeap all ok
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

still not working
yeap all ok was for fsockopen "passed" in green??
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Ok, are you 100% you have the SMTP details correct? Usually the username/password are not the same.

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

password is correct;)
http://www.the9ers.co.uk/help/setup.jpg
http://www.the9ers.co.uk/help/mail.jpg

ps server requires authentication but thats what the password is for yeah ?
Last Edit: 16th November, 2009, 08:58:06 PM by unionjack
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Does your host require a specific port or does it run through SSL?

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

specfic port i think but it says my ssl needs a port to ??

Outgoing Mail Server: mail.the9ers.co.uk (server requires authentication) port 25
Outgoing Mail Server: (SSL) helios.mixial.com (server requires authentication) port 465

almost ready to go check it out Mysite
Last Edit: 16th November, 2009, 10:32:51 PM by unionjack
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

I will take a look into this, it might be due to the port as well as the SSL, I need to see how PHPMailer handles it.

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

any news on this confuser ?
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: Em@il Activation

Just a question, sense sendmail passed is there any reason that you can not use sendmail instead?

"Control yourself. Take only what you need from it"
http://mrrsm.com
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Ok, try this, it will require some editing but it is however a quick fix for now

Open functions/register.php

Find
Code:
$mail->Password = $settings['smtp_password'];


After add
Code:
$mail->Port = 25;
$mail->Mailer = "smtp";


This should work, not tested, however I do not see why it does not work in the first place because the default port is 25 anyhow

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 13
Re: Em@il Activation

nope still not working
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Moving to bugs board

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Ok I believe it might be the actual register function itself, the return is called before the mail is sent out, and within functions, returns are like die(), the rest of the function is not continued. Replace your register.php function with the following, if it works I will update the SVN with it.
Code:

<?php
/* eoCMS is a content management system written in php
    Copyright (C) 2007 - 2009  James Mortemore, Ryan Matthews
    http://www.eocms.com
   This work is licensed under the Creative Commons
   Attribution-Share Alike 3.0 United States License.
   To view a copy of this license, visit
   http://creativecommons.org/licenses/by-sa/3.0/us/
   or send a letter to Creative Commons, 171 Second Street,
   Suite 300, San Francisco, California, 94105, USA.
   Additional license terms at http://eocms.com/license.html
*/
function register($username, $password, $vpassword, $email, $token, $captcha, $tos) {
   global $settings, $error, $error_die;
   call('checktoken', $token);
   if(!empty($settings['tos']) && $tos != 'on') {
      $error[] = 'You must agree to the Terms of Service to register';
      return false;
   }
   if($settings['register_captcha'] =='on')
      $captcha = call('captchacheck', $captcha);
   if($settings['register_captcha'] =='on' && $captcha == false)
      return false;
   $sql = call('sql_query', "SELECT * FROM users WHERE user = '$username'");
   $fetch = call('sql_fetch_array',$sql);
   if ($fetch['user'] == $username) {
      $error[] = 'Username is already taken!';
      return false;
   }
   if (empty($username)) {
      $error[] = 'You did not enter a username'; //idiot how on earth are people meant to know who u are!
      return false;
   }
   if (strlen($password) < 6) {
      $error[] = 'password must be 6 characters or longer!';
      return false;
   }
   $decodedusername = str_replace('&lt;', '<', $username);
   $decodedusername = str_replace('&gt;', '>', $decodedusername);
   if (strlen($decodedusername) > 16) {
      $error[] = 'Your username is too long, it must be below 16 characters';
      return false;
   }
   if ($password != $vpassword) {
      $error[] = 'The passwords entered to do not match';
      return false;
   }
   if (!preg_match("/^([a-z0-9._-](+[a-z0-9])*)+@[a-z0-9.-]+.[a-z]{2,6}$/i", $email)) {
      $error[] = 'The email address entered is not valid';
      return false;
   }
   if (strpos($username, ',') !== false) {
      $error[] = 'Commas (,) are not allowed in a username';
      return false;
   }
   if ($settings['register_approval'] == 'none')
      $group = '2';
   else
      $group = '1';
   if(!errors()) {
      $sql = call('sql_query', "INSERT INTO users (user, pass, email, ip, regdate, lastlogin, membergroup, theme) VALUES('$username', '$password', '$email', '" . call('visitor_ip') . "', '" . time() . "', 'Never', '$group', '".$settings['site_theme']."')");
      if($settings['register_approval'] == 'email') {
         $mail = new PHPMailer();
         //last inserted ID
         $id = call('sql_insert_id');
         //Generate MD5 hash key
         $key = call('generate_key', 6);
         //Put together the key string
         $key_string = "key=$key&id=$id";
         //Insert into database
         $query = call('sql_query', "INSERT INTO activation_keys (user_id , key_number) VALUES ('$id', '$key')");
         if ($settings['mail'] == 'sendmail')
            $mail->IsMail();
         elseif ($settings['mail'] == 'smtp') {
            $mail->IsSMTP();
            $mail->Host = $settings['smtp_host'];
            $mail->SMTPAuth = true;
            $mail->Username = $settings['smtp_username'];
            $mail->Password = $settings['smtp_password'];
         }
         $mail->FromName = $settings['site_name'];
         $mail->From = $settings['email'];
         $mail->AddAddress("$email");
         $mail->Subject = 'Account Activation at' . $settings['site_name'] . '';
         $mail->Body = "Please click the following link to activate your account:n--------n" . $settings['site_url'] . "/index.php?act=activate&$key_string";
         if (!$mail->Send()) {
            $error[] = "Error sending: " . $mail->ErrorInfo;
            return false;
         }
         else
            return true;
      }
   }
}
?>

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1527
Re: Em@il Activation

Mark as fixed please TGPEG

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Designer
eoCMS Designer
Offline Offline
avatar
Posts: 1290
tbarkass_willamson@hotmail.com
Re: Em@il Activation

This bug has been deemed [Fixed] by an eoCMS developer. If you dispute the Fix, please PM a developer, giving details of why. This topic can then be unlocked allowing for further discussion.

Seen a bug? Report it!

Jump to:


0.1 seconds Queries: 13