| View previous topic :: View next topic |
| Author |
Message |
Spark_Plug Green Belt


Joined: 14 Jul 2004 Posts: 141
|
Posted: Sat Oct 02, 2004 5:40 pm Post subject: Mail Function (linux) in PHP |
|
|
I am trying to get the mail function to work I am getting this error: Fatal error: Call to undefined function mail() in /www/register.php on line 37
on line 37 I have this:
| Code: | | mail ($_POST['email'], 'Thank You for registering!', $body, 'From: ''.phorum_html_encode('abranaugh@gmail.com').'''); |
I know it has to do with my php.ini file so my quesiton is what shall i put into the php.ini file? I am using Linux by the way.
Thank You
Adam. |
|
| Back to top |
|
 |
Toby B. Lead Mobo-fu Master


Joined: 16 Dec 2001 Posts: 13960 Location: Maine
|
Posted: Sat Oct 02, 2004 6:37 pm Post subject: |
|
|
Why do you have 2 double qoutes at the end of the line??? Having a single quote at the beginning and a double quote at the end will result in errors being displayed... _________________ We Help You. You Can Help Us!
Read the rules prior to posting
Tell your newsgroup or mailing list
Link to us from your pages |
|
| Back to top |
|
 |
Spark_Plug Green Belt


Joined: 14 Jul 2004 Posts: 141
|
Posted: Sat Oct 02, 2004 6:46 pm Post subject: |
|
|
I think the problem is that I just copied it from another forum where I posted the same message but don't get responces until days later, this is what is really on line 37
| Code: | | mail ($_POST['email'], 'Thank You for registering!', $body, 'From: abranaugh@gmail.com'); |
By the way I am using PHP 5 with Apache2. |
|
| Back to top |
|
 |
Toby B. Lead Mobo-fu Master


Joined: 16 Dec 2001 Posts: 13960 Location: Maine
|
Posted: Sat Oct 02, 2004 6:59 pm Post subject: |
|
|
I'll direct MoboCop to this thread. He knows PHP a lot better then I do. _________________ We Help You. You Can Help Us!
Read the rules prior to posting
Tell your newsgroup or mailing list
Link to us from your pages |
|
| Back to top |
|
 |
MoboCop Drunken Master
Joined: 18 Jan 2000 Posts: 8854 Location: Fresno
|
Posted: Sat Oct 02, 2004 11:00 pm Post subject: |
|
|
strange message mail() is a php function. Not sure how it cannot be defined. _________________ Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien |
|
| Back to top |
|
 |
Toby B. Lead Mobo-fu Master


Joined: 16 Dec 2001 Posts: 13960 Location: Maine
|
Posted: Sat Oct 02, 2004 11:11 pm Post subject: |
|
|
| MoboCop wrote: | | strange message mail() is a php function. Not sure how it cannot be defined. | to have it defined you have to have quotes, brackets, etc. in the correct place and the correct type, correct? _________________ We Help You. You Can Help Us!
Read the rules prior to posting
Tell your newsgroup or mailing list
Link to us from your pages |
|
| Back to top |
|
 |
Spark_Plug Green Belt


Joined: 14 Jul 2004 Posts: 141
|
Posted: Sun Oct 03, 2004 6:23 am Post subject: |
|
|
I think the reason its not working is because I don't have sendmail set up, I downloaded it from sendmail.org. I don't understand the readme file and how to install it, could someone held me please?
EDIT: Got it installed, should i just leave the php.ini file under sendmail_path blank? what should I put in it?
Don't get the error message anymore, doesnt' send the email though. |
|
| Back to top |
|
 |
Spark_Plug Green Belt


Joined: 14 Jul 2004 Posts: 141
|
Posted: Sun Oct 03, 2004 3:19 pm Post subject: |
|
|
Ok, I am trying it with Kmail now, I can send out of kmail with going to compose but still not sending me any email when I run the script. Here is my php.ini file of the mail function:
| Code: | [mail function]
; For Win32 only.
SMTP = smtp.charter.net
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
sendmail_path = /usr/bin/kmail -t -i
sendmail_from = abranaugh@gmail.com
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters = |
|
|
| Back to top |
|
 |
MoboCop Drunken Master
Joined: 18 Jan 2000 Posts: 8854 Location: Fresno
|
Posted: Sun Oct 03, 2004 6:31 pm Post subject: |
|
|
the mail function is defined in php. If you call it wrong you will get missing parameter errors. If you put incorrect quotes you will get a parse errror.
I dont understand the mail() function not being defined. Unless it is perhaps turned off in php.ini? I dont even know if this is possible. Mail function has always worked for me straight out of the default installation.
what errors are you getting now? _________________ Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien |
|
| Back to top |
|
 |
Spark_Plug Green Belt


Joined: 14 Jul 2004 Posts: 141
|
Posted: Mon Oct 04, 2004 1:24 pm Post subject: |
|
|
| MoboCop wrote: | the mail function is defined in php. If you call it wrong you will get missing parameter errors. If you put incorrect quotes you will get a parse errror.
I dont understand the mail() function not being defined. Unless it is perhaps turned off in php.ini? I dont even know if this is possible. Mail function has always worked for me straight out of the default installation.
what errors are you getting now? |
none not sending the email thats all.
I found out kmail is like a outlook express so I have to use send mail.
Can soemone help me out and help me setup sendmail so that i can actually sendmail? When I try sendmail abranaugh@gmail.com
talkdsfal
<ctrl d>
I get the following error: collect: Cannot write ./dfi94LkS1n005864 (bfcommit, uid=1002, gid=251): Permission denied
queueup: cannot create queue file ./qfi94LkS1n005864, euid=1002: Permissiondenied |
|
| Back to top |
|
 |
|