Previous Thread
Next Thread
Print Thread
Rate Thread
#211998 10/02/2001 11:57 AM
Joined: Apr 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Apr 2001
Posts: 9
Doin a search for SMTP on this forum I noticed that you are supposed to be able to use a SMTP server instead of sendmail to send mail.

Turns out that even though we are running our Intranet on Solaris/Apache our IT-department have decided not to configure up sendmail and only will allow me to use our Exchange server via SMTP.

So .... I might have missed it in the manual - but where can you configure the mail in the PHP version? After I installed it and set up an admin account I quickly realized that the password that was 'mailed' to me never arrived smile.

Thanks in advance!

/Björn

Sponsored Links
Joined: May 1999
Posts: 241
Coder
Coder
Offline
Joined: May 1999
Posts: 241
manually, you can telnet to the machine and open config.inc.php .... you will have to comment out the sendmail line and uncomment the smtp one, changing your smtp information...

otherwise, you can use the Admin section through the web... Edit Configuration...

hope that helps!


--------------------
Matt Reinfeldt
http://www.mattreinfeldt.com/
Joined: Apr 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Apr 2001
Posts: 9
Hi,

I feel a bit stupid right now ... but I don't find it.
First I looked in the admin area (I manage another wwwthread forum) but couldn't find a section there regarding mail.

Then I went into the config.inc.php but once again, I couldn't find anything about either sendmail or SMTP .... then I've did a full search of all files after sendmail or smtp and found nothing ....

I haven't checked the CGI-version yet ... is this maybe somehting that only is possible in the CGI-version since you normally just use the mail-function in PHP, which is set up in the php.ini? Bummer that you can't set up SMTP there for a n on-windows machine and have to use a SMTP class ...

Best regards
Björn

Joined: May 1999
Posts: 241
Coder
Coder
Offline
Joined: May 1999
Posts: 241
Actually, *I* feel a bit stupid right now! []/testimages/icons/blush.gif[/] I was thinking about the perl version... if you telnet to your machine, and cd into the wwwthreads directory, cd into 'cron' and edit the w3tvars.pm file you see there... in there, there is a section that looks like this:

# Use sendmail or a SMTP server. If you are on a server that has
# the sendmail program then set $config{'sendmail'} to the location
# of the server. If you do not have sendmail then set
# config{'SMTP'} to the name of the SMTP server you wish to use.
# Make sure you uncomment the one you want to use.
# DO NOT LEAVE BOTH UNCOMMENTED
$config{'sendmail'} = '/usr/sbin/sendmail';
# $config{'SMTP'} = 'name.smtp.server.';

just comment out the sendmail line, uncomment the SMTP line, and put in the name of the server... then you should be good to go...

I totally spaced this one... I am so used to it being part of the main configuration (in Perl) that I forgot you had to set it up differently in PHP...

Sorry!

Matt


--------------------
Matt Reinfeldt
http://www.mattreinfeldt.com/
Joined: Apr 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Apr 2001
Posts: 9
No prob smile. I'm sure it must be hard to separate when you have 2 versions that are not exactly the same.

I must however admin that I'm still stuck. I did the changes but as I see it - these are only accessed when you use any of the cron-jobs - and not otherwise.

I changed it to use the SMTP server and then set up the forum again via createables and the the newupser.php file. Still no mail though with the password ...

I'm thinking about looking up the SMTP-class I've used before and see if I can add it into the code (got to figure out which files call the mail-function) but if it's avoidable I would be very happy smile.

/Björn

Sponsored Links
Joined: May 1999
Posts: 241
Coder
Coder
Offline
Joined: May 1999
Posts: 241
man...!! okay, I looked a little deeper, and that password is getting mailed in the adduser.php file... right near the end, you'll see this:


// -------------------------------------
// Now we need to mail them the password
if ( ($Username) && ($Email) ) {

$to = $Email;
$from = $config[emailaddy];
$subject = "$lang[PASS_SUB] $config[title]";
$msg = "$lang[PASS_BODY1] '$ip' $lang[PASS_BODY2] '$Username'. $lang[PASS_BODY3] '$pass'.";
$mailsend = mail("$to","$subject","$msg","From: $from");


it looks like it's using a native php function mail... don't know what that defaults to... might want to check your PHP configuration...?

Anyone else have any ideas? (obviously, I'm not a big PHP-guru! []/testimages/icons/wink.gif[/])

Matt


--------------------
Matt Reinfeldt
http://www.mattreinfeldt.com/
Joined: Apr 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Apr 2001
Posts: 9
Thanks anyway for trying to help me!
YEah, it looks like it is set up to only use the included mail-function. Normally this is fine but when you have pig-headed smile sys-admins that don't want to config sendmail on the server (it's a Intranet BTW) then you are out of luck since the config of PHP only works with SMTP when you are on a Windows server.

I actually kind of fixed it by digging up a SMTP-class in PHP that I've been using before. Then I went into every wwwthreads hp-file and looked for

$mailsend = mail(" etc.

and then substituted it with the smtp-class line and it looks like it works smile. It took a bit of time and I haven't tested every mail-feature but at least I got the initial password mailed to me smile.

Best regards
Björn

Joined: Oct 2001
Posts: 2
Lurker
Lurker
Offline
Joined: Oct 2001
Posts: 2
How did you get that to work??

Joined: Mar 2000
Posts: 84
Member
Member
Offline
Joined: Mar 2000
Posts: 84
Check here:

http://www.php.net/manual/en/ref.mail.php

There seems to be a few dicsussions about exchange replacing the mail() function there.

Joined: Oct 2001
Posts: 2
Lurker
Lurker
Offline
Joined: Oct 2001
Posts: 2
thanks, but I continued searching the site and found what I needed, it was just a simple line change in the php.ini file for the smtp to send mail, and now it works great!
[]/testimages/icons/laugh.gif[/]

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)