Koozali.org: home of the SME Server

PHP mail functions...HELP!!!!

Brad

PHP mail functions...HELP!!!!
« on: February 28, 2002, 06:39:53 AM »
Hi all,
Im am having probs sending mail automatically in a PHP script. Can someone
tell me:
A) Do the neccesary PHP functions/library come 'pre-packed' with e-smith
4.1.2??

b) if not, how, where do i get them


c) Is there a way to find out why it isnt sending me the mail

This is driving me nuts...no error msages..but no mail comming thru either :(

Thanks in advance,
Brad

Dan Brown

Re: PHP mail functions...HELP!!!!
« Reply #1 on: February 28, 2002, 06:49:10 AM »
A.  Yes, this is included with the PHP that ships with 4.1.2 (though it's recommended that you upgrade to 5.1.2).  After all, it's included specifically to handle the webmail system, so it should be able to handle sending mail.

B.  see above.

C.  Probably, but that's beyond what I know at this point.  This might be a point where you'd want to post on the PHP lists.

Des Dougan

Re: PHP mail functions...HELP!!!!
« Reply #2 on: February 28, 2002, 06:59:16 AM »
Brad wrote:
>
> Hi all,
> Im am having probs sending mail automatically in a PHP
> script. Can someone
> tell me:
> A) Do the neccesary PHP functions/library come 'pre-packed'
> with e-smith 4.1.2??

Not sure about 4.1.2, but they are certainly there with 5.1.2

>
> b) if not, how, where do i get them
>
There are some add-in functions available on php.net (plus all the docs for PHP itself). Look for mailVal.php - it is pretty nifty.
>
> c) Is there a way to find out why it isnt sending me the mail

Check the qmail logs?


Des Dougan

Brad

Re: PHP mail functions...HELP!!!!
« Reply #3 on: February 28, 2002, 07:29:46 AM »
Des,
Thanks,
where would i find the qmail logs??

cheers

Des Dougan

Re: PHP mail functions...HELP!!!!
« Reply #4 on: February 28, 2002, 07:38:21 AM »
Try /var/log/maillog, /var/log/qmail/current.


Des Dougan

Brad

Re: PHP mail functions...HELP!!!!
« Reply #5 on: February 28, 2002, 08:09:21 AM »
Its not working at all.... the log in '/var/log/maillog' has no entries corresponding to the activities of the mail finction i used:



 mail("brad@mydomain.com.au", "it worked", "Line 1\nLine 2\nLine 3");


Is this correct syntax...no error in broweser when page is loaded??

Des Dougan

Re: PHP mail functions...HELP!!!!
« Reply #6 on: February 28, 2002, 08:23:11 AM »
mail(toaddress, subject, mailcontent, fromaddress) is the syntax I've used and had work.

Des Dougan

Brad

Re: PHP mail functions...HELP!!!!
« Reply #7 on: February 28, 2002, 08:29:17 AM »
nope des, that didnt help either

any other ideas??

Des Dougan

Re: PHP mail functions...HELP!!!!
« Reply #8 on: February 28, 2002, 08:38:47 AM »
Well, I'd upgrade to 5.1.2 as Dan recommended, and start from there. I'm working to learn PHP, so am no expert, but I had no problems with the mail functions on the 5.1 betas and released version.

Des

Brad

Re: PHP mail functions...HELP!!!!
« Reply #9 on: February 28, 2002, 08:42:23 AM »
Thanks Dan,
yeh I would, but Im in the middle of developing something that i started in 4.1.2 so dont wanna mess around with new upgrade until finished prototype....(at least)... did you upgrade to 5.x from 4.1.2???..if so, did you have any problems?? did it change all the settings (ie mysql root user etc)?? .

Thanks for your help, mate. Its very much appreciated. Bloody frustratin when this sort of thing happens :(

Cheers,
Brad

Dan Brown

Re: PHP mail functions...HELP!!!!
« Reply #10 on: February 28, 2002, 04:30:21 PM »
Yes, the upgrade changed the mysql root password, but not much else.  This shouldn't cause a problem, as you shouldn't be using the root user for much of anything anyway.

That said, I'm not at all sure that upgrading to 5.1.2 will do you any good.  The PHP included with 4.1.2, AFAIK, includes all the necessary functions.  FWIW, though, that exact syntax works for me on 5.1.2 with my PHP upgrades installed.