You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 70 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Fixed: User Registration E-mail Not Sending [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Andevian
Nuke Cadet
Nuke Cadet


Joined: Oct 13, 2003
Posts: 4


PostPosted: Fri Dec 31, 2004 8:23 am Reply with quoteBack to top

Exact Problem Description: When a new user attempts to sign up for your PHP-Nuke site, he/she is taken to the final registration screen, clicks on Finish, and is shown a page that indicates an e-mail has been sent to confirm their registration. The user never receives the e-mail, there is no error on the page. In my case, the site's error log showed nothing.
Other mail functions, just as the password retrieval system, also do not work.

Solution: I apologize if this fix, or a better one, is already posted somewhere. I looked, and all I found was a work-around to disable the mail function altogether, and that's not what I wanted.
If you're nervous about following directions or editing PHP files then this fix may not be for you. I'm going to tell you exactly what I did to fix it on my version, you may have to change the directions somewhat if your version looks different.
I'm using a fresh install of PHP-Nuke 7.4 upgraded to 7.5 HA available from www.hackerassassins.com on a Linux server running PHP 4.something and Apache 1.3.something.

First, I figured the problem was related to the mail() function that PHP-Nuke uses. So, the first order of business was to find a valid solution. I found one right there in the included PHPBB code. That code either has a typo or it expects me to have rights on my provider's server that I don't have. So, I rewired it!
Edit the emailer.php file found in <php-nuke-root>/includes/. Find the line that looks like this (7.4 base has it on line 239, 7.5 HA has it on line 242):
Code:
include('includes/smtp.' . $phpEx);

Since there is a perfectly valid smtp.php right there in the same folder, there's no sense for it to refer to one someplace else. Change the line to:
Code:
include('smtp.' . $phpEx);

Well that was easy enough, wasn't it? Now you need to test. Go into your Forum Admin tool and try to send a Mass Mail. Be a good admin and have a messageboard group that only contains you so you don't spam your entire membership. If this works, then you can use the rest of the fix. If the test doesn't work, then don't bother reading further, you'll have to do something else to fix your particular problem.

Now on to the more complicated part. Still in the /includes/ directory, make a copy of the smtp.php file. I called mine smtpmini.php, but you can call it anything you like. You could even edit the original if you want, but I prefer not to modify distribution files beyond the absolute minimum necessary for them to work as intended, and this file already works as intended.
Edit your copied file. Find the line that's all by itself near the top of the function smtpmail() that is all by itself and looks like this (line 85 in both 7.4 and 7.5HA):
Code:
global $board_config;

Since your normal site doesn't work within the structure of the PHPBB forum, we have to populate this variable ourselves. To do so, replace the above line with:
Code:
global $db, $prefix;
$board_config = array();
$sql = "SELECT * FROM ".$prefix."_bbconfig";
if( !($result = $db->sql_query($sql)) )
{
   die("Could not query config information");
}

while ( $row = $db->sql_fetchrow($result) )
{
   $board_config[$row['config_name']] = $row['config_value'];
}

The above code was taken from the PHPBB forum code, the only modification being a replacement of the message_die() function, which has never worked on any PHP site I've ever run, with a regular die() function.

And now, finally, we're almost done. Open up the index.php in <php-nuke-root>/modules/Your_Account. Find all instances of the following (they are NOT all coded the same, search for the word 'mail' and match whole word only, there are 3 instances on lines 146, 746, and 779 in 7.4, and on lines 150, 736, and 766 in 7.5HA):
Code:
mail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());

Replace the above code with:
Code:
include("includes/smtpmini.php");
smtpmail($user_email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());

If you named your copied file something other than smtpmini.php, then change that portion of the above code to match.

And that's it! All mail functions that are part of the Your_Account module will work just fine. The best part is that if you find other instances of the mail() function in your site that don't work, all you have to do is the same replacement of the last two lines in whatever module you find that doesn't work.
Find all posts by AndevianView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.180 Seconds - 289 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::