now to use this with any module inside nuke that uses the mail() command, can send mail through the specified server with a minor code change
open the following files and on or near the lines mentioned you'll see
Code:
mail(
change it to:
Code:
mailviasmtp(
/banners.php - lines 82 & 328
/modules/Feedback/index.php - line 93
/modules/Journal/friend.php - line 48
/modules/News/friend.php - line 77
/modules/Recommend_Us/index.php - line 54
/modules/Submit_News/index.php - line 252
/modules/Recommend_Us/index.php - line 54
/modules/Your_Account/index.php - lines 146 & 653 & 683
/admin/modules/links.php - line 1125
/admin/modules/newsletter.php - lines 123 & 150
that should do it.
tech note: i know board_config is setup in forum admin, but i decided to use 1 less sql query and hard code it.
EDIT: renamed email function to mailviasmtp since it conflicted with php-nuke tools module
Eyecu Nuke Cadet
Joined: Feb 07, 2004
Posts: 3
Posted:
Sat Feb 07, 2004 9:31 pm
Hello
Ok i did all your said ^^^ and it fixed the one error i was getting but now i get an undefined function error on line 78 of smtp.php when I click on finish in the user registration process. The exact error is :
Fatal error: Call to undefined function: message_die() in D:\hshome\nvgaboon\lilfukker.net\PHP\includes\smtp.php on line 78
Im running 7.1. Any help would be appreciated!
Thank You
Wes Bullard
cclang Nuke Cadet
Joined: Feb 08, 2004
Posts: 2
Posted:
Sun Feb 08, 2004 1:13 am
I also added the lines posted above and am getting
Fatal error: Call to undefined function: message_die() in c:\program files\apache group\apache\htdocs\html\includes\smtp.php on line 41
when i click finish in the user registration page. Then i edited smtp.php like you said to do here -->
Quote:
it'd be easier to just edit smtp.php to get the error out in the open
Code:
message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", $line, __FILE__);
to
Code:
//message_die(GENERAL_ERROR, "Ran into problems sending Mail. Response: $server_response", "", $line, __FILE__);
echo $server_response
and now im getting
Fatal error: Call to undefined function: smtpmail() in c:\program files\apache group\apache\htdocs\html\mainfile.php on line 235
the error dump isn't pretty but it gets the point across
Quote:
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 550 Sender verify failed
ON LINE 40
IN FILE /home/voicesi/public_html/secretlab/includes/smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 503 valid RCPT command must precede DATA
ON LINE 40
IN FILE /home/voicesi/public_html/secretlab/includes/smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 500 unrecognized command
ON LINE 40
IN FILE /home/voicesi/public_html/secretlab/includes/smtp.php
cclang Nuke Cadet
Joined: Feb 08, 2004
Posts: 2
Posted:
Sun Feb 08, 2004 2:24 am
Umm i havent tried this yet, but i fixed the error by following this fix
Code:
find the file "emailer.php" , about 237-240,
Code:
if ( !defined('SMTP_INCLUDED') )
{
include('includes/smtp.' . $phpEx);
}
modify the path of smtp.php:
Code:
if ( !defined('SMTP_INCLUDED') )
{
include('../../../includes/smtp.' . $phpEx);
}
which was for the mass emailer function in the forums. It sends the confirmation email and the activation email works, but now I am getting this error
Fatal error: Cannot redeclare server_parse() (previously declared in c:\program files\apache group\apache\htdocs\html\includes\smtp.php:29) in c:\program files\apache group\apache\htdocs\html\includes\smtp.php on line 29
I will try the new function, just letting you. Thanks for the quick response.
EJ Nuke Soldier
Joined: Jan 08, 2004
Posts: 11
Posted:
Thu Feb 12, 2004 12:38 pm
Hello,
I'm having problem with my email function on my site.
The server is at home hosted by my isp cable.
running on windows 2000 server and PHPNUKE 6.9.
When users try to registered they dont get the activation on their email.
I have change all possible smtp still no luck.
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 533 5.7.1 AUTH command is not enabled.
ON LINE 164
IN FILE c:\inetpub\wwwroot\includes\smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 500 5.5.1 Unknown command "cnBjbGFuQG9wdG9ubGluZS5uZXQ=" specified
ON LINE 167
IN FILE c:\inetpub\wwwroot\includes\smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 500 5.5.1 Unknown command "MHJtb25kZQ==" specified
ON LINE 170
IN FILE c:\inetpub\wwwroot\includes\smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 554 5.5.0 No recipients have been specified.
ON LINE 226
IN FILE c:\inetpub\wwwroot\includes\smtp.php
ERROR DUMP
ERROR CODE GENERAL_ERROR
ERROR TEXT Ran into problems sending Mail. Response: 500 5.5.1 Unknown command "Subject: User Password for edwin" specified
ON LINE 242
IN FILE c:\inetpub\wwwroot\includes\smtp.php
Also where should I do this?
Quote:
EDIT: renamed email function to mailviasmtp since it conflicted with php-nuke tools module
Here's my mainfile.php look like with your code, is this correct?
//smtp email hack by Disgruntledtech
include('mailhack.php');
function get_lang($module) {
global $currentlang, $language;
if (file_exists("modules/$module/language/lang-$currentlang.php")) {
if ($module == admin) {
Also I created mailhack.php in the root directory.
And still send mail doesn't work, either lost password or new user registration.
I use Outlook Express sending mail and receiving mail works.
EJ Nuke Soldier
Joined: Jan 08, 2004
Posts: 11
Posted:
Thu Feb 12, 2004 1:59 pm
I have to put back the codes the way it was before, because the forum is not working when I do your code.
Also when I do recommend us it with or without your code it does send email.
weird !!!
Please help
softwar Nuke Cadet
Joined: Feb 22, 2004
Posts: 6
Posted:
Mon Mar 01, 2004 11:01 am
I have the same error: ERROR DUMP... What's wrong? I did everything what was written.
DamRipper Nuke Soldier
Joined: Mar 03, 2004
Posts: 11
Posted:
Mon Mar 08, 2004 3:11 pm
Thanks that fixed my problem but i didnt have to rename a module with version 7.0.
nortonweb Nuke Cadet
Joined: Apr 18, 2004
Posts: 1
Posted:
Sun Apr 18, 2004 8:27 pm
Cheers disgruntledtech
totally sorted out my emailing problem
Most Cool
Pete
Piratetrader Nuke Soldier
Joined: Mar 07, 2004
Posts: 17
Posted:
Sat Apr 24, 2004 12:18 pm
Eyecu wrote:
Hello
Ok i did all your said ^^^ and it fixed the one error i was getting but now i get an undefined function error on line 78 of smtp.php when I click on finish in the user registration process. The exact error is :
Fatal error: Call to undefined function: message_die() in D:\hshome\nvgaboon\lilfukker.net\PHP\includes\smtp.php on line 78
Im running 7.1. Any help would be appreciated!
Thank You
Wes Bullard
Same exact problem but did not see a answer to it.
Pirate
_________________
pieceofpeace Nuke Cadet
Joined: Jun 13, 2004
Posts: 3
Posted:
Wed Jun 16, 2004 1:27 pm
I solved all my errors by using the smtpmail-function in each file listed above. It is defined in smtp.php.
Replace the mail() with smtpmail and it should work.
Right above that you should type in each file:
Code:
include('includes/smtp.php');
If you get an error indicating that the smtp-server isn't found,
edit your smtp.php in /includes/ like this:
Code:
// Replacement or substitute for PHP's mail command
function smtpmail($mail_to, $subject, $message, $headers = '')
{
global $board_config;
//from here...
$board_config['smtp_host'] = "smtp.server.domain";
$board_config['smtp_username'] = "username";
$board_config['smtp_password'] = "password";
$board_config['board_email'] = "emailaddress";
//to here is what you have to add
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
Some servers only accept emails when emailaddress is the email address connected to that username and password or at least
an email adress with .domain.
if this is stupid, don't flame me. don't know squad about php...
but it works for me.
confuxicated Nuke Cadet
Joined: Jul 15, 2004
Posts: 1
Posted:
Wed Jul 14, 2004 8:13 pm
i did what was said at the top by adding the mailsmtp( thing on all those pages and now when a user goes to signup they get this.
Code:
Warning: fsockopen(): php_network_getaddresse
help?
free69 Captain
Joined: Jan 18, 2003
Posts: 333
Location: Sniper Mobile Command
Posted:
Sun Jul 25, 2004 3:28 pm
Dear pieceofpeace,
I cannot find what makes redeclare message. Don't you have any clue?
=======================
I got below error ;
Fatal error: Cannot redeclare smtpmail() (previously declared in D:\xampp\htdocs\home\includes\smtp.php:29) in D:\xampp\htdocs\home\includes\smtp.php on line 198
Now then,
I've been battling with this problem for over a week, using PHPNuke 7.4, then 7.3, 7.2, and 7.1 running on Mandrake 9.1, PHP 4.2 and MySQL and had no luck with any of it, i tried every workaround, fix, hack and bodge in the book until today when i dug out an old version of 7.0 and used the mailhack include listed above.... and it now works a treat..
Thanks Disgruntledtech
Muhahaha
The Phantom
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