LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2008, 12:53 AM   #1
chifun
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Rep: Reputation: 0
apache don't know sent out email


Hi,

I am using FC3 with sendmail. I am using DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl. I can sent out email by smtp and receive email.

But in my server. All the CGI and PHP programs cannot sent out email.
All the programs running fine. Just don't know why cannot sent out email.

The sendmail path also is correct : /usr/sbin/sendmail

And in the accress: localhost , 127.0.0.1 is relay

Please kindly help how to fix this problem. Thx a lot.

Last edited by chifun; 11-21-2008 at 12:56 AM.
 
Old 11-21-2008, 01:39 AM   #2
nidhinmd
Member
 
Registered: Aug 2007
Location: Cochin, Kerala, India
Posts: 32

Rep: Reputation: 3
Use this code

<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
 
Old 11-21-2008, 02:25 AM   #3
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
Quote:
Originally Posted by chifun View Post
Hi,

I am using FC3 with sendmail. I am using DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl. I can sent out email by smtp and receive email.

But in my server. All the CGI and PHP programs cannot sent out email.
All the programs running fine. Just don't know why cannot sent out email.

The sendmail path also is correct : /usr/sbin/sendmail

And in the accress: localhost , 127.0.0.1 is relay

Please kindly help how to fix this problem. Thx a lot.
THIS SETTING I APPLIED IN RHEL4 ON MY OWN SERVER.

PART 1:
1. vi etc/hosts (add the remote server ip address and its domain name in etc/hosts.

192.168.2.3 smtp.example.com

PART 2:

1. vi /etc/mail/sendmail.mc
2. find "dnl #define('SMART_HOST','smtp.example.net')"
3. replace this by your smtp server address. (ex.yahoomail.smtp.net)
4. run make -C /etc/mail
5. service sendmail restart

1. if you want to start on boot. type "chkconfig sendmail on"
 
Old 11-22-2008, 02:43 AM   #4
chifun
LQ Newbie
 
Registered: Nov 2008
Posts: 4

Original Poster
Rep: Reputation: 0
thx a lot will try
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache don't know sent out email chifun Linux - Server 2 11-21-2008 07:20 PM
How do I connect a linux internet server (apache/email) to windows 2000 domain? Linux_viper Linux - General 2 05-10-2006 07:40 AM
apache from email address helpme0904 Linux - Newbie 1 04-28-2006 02:22 PM
Apache 1.3 webserver email housemusic42 Linux - Software 1 12-17-2005 12:33 PM
can someone email me steps to download apache? pcdctr Linux - Newbie 1 07-25-2004 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration