LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-24-2005, 10:55 PM   #1
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Rep: Reputation: 15
Exclamation php mail function


i had tried to make some changes in the configuration of sendmail ... but my php mail function still not working, didnt receive any email ... izzit can check the sendmail is working correctly ? can some1 show me the way ...

thnx alot ...

Last edited by akamaru607; 08-25-2005 at 12:58 AM.
 
Old 08-25-2005, 12:22 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
Maybe check the log (it's /var/log/maillog on my system), to see what's happening when mail is being sent?
 
Old 08-25-2005, 12:29 AM   #3
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
it came out with this
-bash: /var/log/maillog: Permission denied

sorry, im totally new in linux ... wat wrong with tat ? anyway thanx
 
Old 08-25-2005, 12:37 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
Did you just type "/var/log/maillog" in a terminal? You need to open it with a text editor (as root). To become root, type "su" (without quotes) and then your root password when prompted. Then open the file with the name of the editor you want to use (emacs, vi, joe, kate, gedit, nano, pico, etc) followed by the filename, eg. "pico /var/log/maillog".
 
Old 08-25-2005, 12:37 AM   #5
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
this is my php.ini

[mail function]
; For Win32 only.
SMTP = localhost.localdomain
smtp_port = 25

; For Win32 only.
;sendmail_from = root@localhost.localdomain


then im testing with this php code ...

<?php
$to = 'dyer607@hotmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>
 
Old 08-25-2005, 12:45 AM   #6
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
Aug 25 13:35:07 localhost sendmail[7721]: j7P5Z4UZ007721: to=mailman, ctladdr=mailman (41/41), delay=00:00:03, xdelay=00:00:03, mailer=relay, pri=30302, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j7P5Z5Ii007723 Message accepted for delivery)
Aug 25 13:35:08 localhost sendmail[7724]: j7P5Z5Ii007723: to=root, ctladdr=<mailman@localhost.localdomain> (41/41), delay=00:00:01, xdelay=00:00:01, mailer=local, pri=30839, dsn=2.0.0, stat=Sent
Aug 25 13:40:10 localhost sendmail[7811]: j7P5e9Ub007811: from=mailman, size=302, class=0, nrcpts=1, msgid=<200508250540.j7P5e9Ub007811@localhost.localdomain>, relay=mailman@localhost
Aug 25 13:40:15 localhost sendmail[7814]: j7P5eBtg007814: from=<mailman@localhost.localdomain>, size=584, class=0, nrcpts=1, msgid=<200508250540.j7P5e9Ub007811@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 25 13:40:16 localhost sendmail[7811]: j7P5e9Ub007811: to=mailman, ctladdr=mailman (41/41), delay=00:00:07, xdelay=00:00:06, mailer=relay, pri=30302, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j7P5eBtg007814 Message accepted for delivery)
Aug 25 13:40:19 localhost sendmail[7818]: j7P5eBtg007814: to=root, ctladdr=<mailman@localhost.localdomain> (41/41), delay=00:00:04, xdelay=00:00:03, mailer=local, pri=30839, dsn=2.0.0, stat=Sent


this the some of it i copy ... wat should i check with the log file ? sorry on troubling u with this kind of Q, i really wish i can solve it in soon ...
 
Old 08-25-2005, 12:45 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
Quote:
Originally posted by akamaru607
this is my php.ini

[mail function]
; For Win32 only.
SMTP = localhost.localdomain
smtp_port = 25

; For Win32 only.
;sendmail_from = root@localhost.localdomain
Did you set those yourself? If so, you shouldn't have as they're for Windows only..

Edit: in your log file are there any lines that contain the address you're trying to send to, dyer607@hotmail.com?

Last edited by Nylex; 08-25-2005 at 12:47 AM.
 
Old 08-25-2005, 12:50 AM   #8
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
ya, i set it, i not really understand with those README ... so izzit anything wrong with tat ? im using fedora 3 ...
 
Old 08-25-2005, 12:52 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
Well it clearly says "For Win32 only" and since you're using Linux..

Edit: also, don't use "HELP !!!" in thread titles, it won't help your thread get more attention.

Last edited by Nylex; 08-25-2005 at 12:55 AM.
 
Old 08-25-2005, 12:55 AM   #10
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
-_-" omg ... i really din notice that ... so this following this need to set something ?

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i

Last edited by akamaru607; 08-25-2005 at 12:57 AM.
 
Old 08-25-2005, 12:57 AM   #11
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
If that's the path to your sendmail, leave it as it is, unless you want to use different arguments (see "man sendmail" for details of those).
 
Old 08-25-2005, 01:00 AM   #12
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
okok, go n hav a look now ... anyway thanx u so much !!!
 
Old 08-25-2005, 01:06 AM   #13
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
oh yah Nylex, can u help me on this problem
"/bin/sh: mailman: command not found"
wat is the problem ?
 
Old 08-25-2005, 01:08 AM   #14
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,371

Rep: Reputation: Disabled
The problem is either that you don't have "mailman" installed, or that the path to its executable isn't in your $PATH environment variable.
 
Old 08-25-2005, 01:35 AM   #15
akamaru607
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 22

Original Poster
Rep: Reputation: 15
there is a executable mailman in /usb/lib/mailman/mail ... if it isn't in the $PATH environment variable ... so what should i do ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Mail() function doesn't work Messiadbunny Linux - Software 4 06-11-2005 04:40 AM
How does the mail function work(PHP) Alexander.s Programming 1 05-15-2005 09:02 AM
PHP Mail and Foreach function Gerardoj Programming 6 10-08-2004 05:24 PM
PHP - mail function saravanan1979 Programming 2 08-06-2003 01:46 AM
Using the PHP mail() Function !?!? Hdata Programming 0 06-22-2003 06:02 AM


All times are GMT -5. The time now is 04:59 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration