Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 09:09:10 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155553 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: "Unable to email password, please contact system administrator"  (Read 2717 times)
Bonkie

Offline Offline

Posts: 40


« on: May 03, 2006, 08:28:48 AM »

When i reset a userpassword or try to make a new user from the frontend it refuses to send me the password.
when i try a reset it says: "Unable to email password, please contact system administrator"

i am using 2.6.3 when i search the forum i can only find the problem in 2.6.2 with the -f option in the code of wb but that has been already removed in 2.6.3 anyone has the same problem and can help me?

a link to my php info is here:
http://www.dronkendropje.nl/phpinfo.php
« Last Edit: May 03, 2006, 08:30:46 AM by Bonkie » Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #1 on: May 03, 2006, 09:27:20 AM »

there is a ticket, No. 167. View it here:

http://projects.websitebaker.org/websitebaker2/ticket/167

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Bonkie

Offline Offline

Posts: 40


« Reply #2 on: May 03, 2006, 09:39:29 AM »

mailserveis is definetley running....

i tryed tried to run this script

$toaddress = "***";
$subject = "testjuh";
$message = "dsfdfdsfdsfds fgdsfg dfgdsfg dsfg s";
$charset='utf-8';

      $headers  = "MIME-Version: 1.0\n";
      $headers .= "Content-type: text/plain; charset=".$charset."\n";
      $headers .= "X-Priority: 3\n";
      $headers .= "X-MSMail-Priority: Normal\n";
      $headers .= "X-Mailer: websitebaker\n";
      $headers .= "From: ".$fromaddress."\n";
      $headers .= "Return-Path: ".$fromaddress."\n";
      $headers .= "Reply-To: ".$fromaddress."\n";
      $headers .= "\n"; // extra empty line needed??

mail($toaddress, $subject, $message, $headers)

and this works so it must be another problem
Logged
Stefan
Guest
« Reply #3 on: May 03, 2006, 09:42:02 AM »

So can you play with class.wb.php function mail to find out what causes the problem?
Maybe it has to do with the \r\n stuff (which is for line ending conversion).
Logged
Bonkie

Offline Offline

Posts: 40


« Reply #4 on: May 03, 2006, 10:03:21 AM »

ok i will try that Cheesy

i thought there may be a know solution but when i find it i will post it here Cheesy


edit1:
well.... i was experimenting with the php function errorreporting on ALL and notiched this error:

Notice: Undefined offset: 0 in /home/httpd/vhosts/dronkendropje.nl/httpdocs/wb/framework/class.frontend.php on line 315

I dont think this is it.... but maybe it is another bug?Huh

edit2:
ok my bad... it is the template i use Cheesy

edit3:

i traced my error (noted in the fist post) back to this line:
Code:
$fromaddress = preg_replace('/[\r\n]/', '', $fromaddress);

this is the modification i made to make it work:
Code:
function mail($fromaddress, $toaddress, $subject, $message) {
//$fromaddress = preg_replace('/[\r\n]/', '', $fromaddress);
$toaddress = preg_replace('/[\r\n]/', '', $toaddress);
$subject = preg_replace('/[\r\n]/', '', $subject);
$fromaddress = "tom@dronkendropje.nl";
if ($fromaddress=='') {
$fromaddress = SERVER_EMAIL;
}
if(defined('DEFAULT_CHARSET')) {
$charset = DEFAULT_CHARSET;
} else {
$charset='utf-8';
}
$headers  = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=".$charset."\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: websitebaker\n";
$headers .= "From: ".$fromaddress."\n";
$headers .= "Return-Path: ".$fromaddress."\n";
$headers .= "Reply-To: ".$fromaddress."\n";
$headers .= "\n"; // extra empty line needed??
if (OPERATING_SYSTEM=='windows') {
str_replace("\n","\r\n",$headers);
str_replace("\n","\r\n",$message);
}
if(mail($toaddress, $subject, $message, $headers)) {
return true;
} else {
return false;
}
}

now i want to know where it gets the "$fromaddress" from

edit4:

i notiched an error in the dutch translation
http://addons.websitebaker.org/media/download_gallery/NL.txt

on line 422 i belive

$$MESSAGE['START']['WELCOME_MESSAGE'] = 'Welkom bij het website-beheer';

shout be (note the beginning)

$MESSAGE['START']['WELCOME_MESSAGE'] = 'Welkom bij het website-beheer';
« Last Edit: May 03, 2006, 11:32:17 AM by Bonkie » Logged
Bonkie

Offline Offline

Posts: 40


« Reply #5 on: May 03, 2006, 12:04:52 PM »

OK new post...
al the editting does not help clear things up Cheesy

in my last post i mentioned the "$fromaddress".

i fount ou that it is a setting it needs to call SERVER_EMAIL from the database.. but i cant seem to be able to find the file where it defines this mith the value in the database...

something like this:
define('SERVER_EMAIL',

where can i find this??? (in witch file or what function is used??)
« Last Edit: May 03, 2006, 12:09:17 PM by Bonkie » Logged
Bonkie

Offline Offline

Posts: 40


« Reply #6 on: May 03, 2006, 12:21:16 PM »

ok found out that
   // Get website settings (title, keywords, description, header, and footer)
   $query_settings = "SELECT name,value FROM ".TABLE_PREFIX."settings";
   $get_settings = $database->query($query_settings);
   if($database->is_error()) { die($database->get_error()); }
   if($get_settings->numRows() == 0) { die("Settings not found"); }
   while($setting = $get_settings->fetchRow()) {
      $setting_name=strtoupper($setting['name']);
      $setting_value=$setting['value'];
      if ($setting_value=='false')
         $setting_value=false;
      if ($setting_value=='true')
         $setting_value=true;
      define($setting_name,$setting_value);
   }

is defining the settings but now i want to find out why SERVER_EMAIL is not working Cheesy
Logged
Bonkie

Offline Offline

Posts: 40


« Reply #7 on: May 03, 2006, 12:28:22 PM »

OK i figured it all out now....
this bit of code in account/forgot_form.php produced the problem
Code:
if($wb->mail('From: '.SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
$message = $MESSAGE['FORGOT_PASS']['PASSWORD_RESET'];
$display_form = false;
} else {
$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".$old_pass."' WHERE user_id = '".$results_array['user_id']."'");
$message = $MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'];
}

if removed the 'From: '. bit on line 92 like this
Code:
if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {

now it is working correctley

PROBLEM SOLVED  afro

By the way.

you also have to change line 129 in signup2.php Cheesy else the user won't get the first mail when he makes an account
« Last Edit: May 03, 2006, 12:31:30 PM by Bonkie » Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #8 on: May 03, 2006, 01:02:08 PM »

Hello,

can you post this in the bugtracker so ryan or stefan could (if it is really a bug wich seems so) implement it in the next version?

Thanks for your addition to WB

Matthias
Logged
Bonkie

Offline Offline

Posts: 40


« Reply #9 on: May 03, 2006, 01:11:36 PM »

DONE  grin
Logged
Stefan
Guest
« Reply #10 on: May 03, 2006, 01:30:52 PM »

Great, will be fixed ASAP.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!