Set server settings...yes or no?

Thread Solved

Join Date: Feb 2008
Posts: 478
Reputation: maydhyam is an unknown quantity at this point 
Solved Threads: 1
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Pro in Training

Set server settings...yes or no?

 
0
  #1
Mar 14th, 2008
Hello,

Quick question...For the email code in the PHP script to work, do I have to make any server settings? or make any accomodation for the type of server it is being run on? If so, then please guide me...

The application is located on a Linux server.
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 100
Reputation: petr.pavel is an unknown quantity at this point 
Solved Threads: 14
petr.pavel's Avatar
petr.pavel petr.pavel is offline Offline
Junior Poster

Re: Set server settings...yes or no?

 
0
  #2
Mar 14th, 2008
Hi maydhyam,
if you use a professional hosting (someone has set up the server for you) you don't have to worry about anything. Just use mail().

If you're running your own server (e.g. development server) then you need to check php.ini section [mail function]. For Linux you have to verify that sendmail_path is correct.
Petr 'PePa' Pavel

The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 478
Reputation: maydhyam is an unknown quantity at this point 
Solved Threads: 1
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Pro in Training

Re: Set server settings...yes or no?

 
0
  #3
Mar 14th, 2008
Ok, I'm not quite sure what to do...I found the php.ini file, and this is what it says:

[mail function]
; For Win32 only.
SMTP = localhost
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 =

; 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 =
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 100
Reputation: petr.pavel is an unknown quantity at this point 
Solved Threads: 14
petr.pavel's Avatar
petr.pavel petr.pavel is offline Offline
Junior Poster

Re: Set server settings...yes or no?

 
0
  #4
Mar 14th, 2008
That's it. You said you have a linux box so you have to locate sendmail - I assume that you have it installed. To find where your sendmail is run:
  1. locate sendmail
then uncomment the sendmail_path row and enter the full path incl. the switches. For example:
  1. sendmail_path = /usr/sbin/sendmail -t -i
That should do.

Just curious: are you able to send e-mails from the box using pine or mutt? PHP usually works with default settings just fine if sendmail isn't installed into some unusual location. What I mean is that you could in fact, be having a sendmail problem, not PHP configuration problem.
Petr 'PePa' Pavel

The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 68
Reputation: JRSofty is an unknown quantity at this point 
Solved Threads: 10
JRSofty's Avatar
JRSofty JRSofty is offline Offline
Junior Poster in Training

Re: Set server settings...yes or no?

 
0
  #5
Mar 14th, 2008
Nevermind what I said do what Petr.Pavel says
Last edited by JRSofty; Mar 14th, 2008 at 12:22 pm.
JRSofty Programming | .NET Dreaming | GalahTech

If your question is solved then mark the thread solved. If someone gives you good advice then give them some rep.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 478
Reputation: maydhyam is an unknown quantity at this point 
Solved Threads: 1
maydhyam's Avatar
maydhyam maydhyam is offline Offline
Posting Pro in Training

Re: Set server settings...yes or no?

 
0
  #6
Mar 17th, 2008
Hey,

Thank You Petr 'PePa' Pavel, it worked like a charm...
Thanks All..
The man who in view of gain thinks of righteousness; who in the view of danger is prepared to give up his life; and who does not forget an old agreement however far back it extends - such a man may be reckoned a complete man.
~ Confucius, The Confucian Analects
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 6
Reputation: jprahst32 is an unknown quantity at this point 
Solved Threads: 0
jprahst32 jprahst32 is offline Offline
Newbie Poster

Same Problem

 
0
  #7
Feb 16th, 2009
Hello,

I have a php form that will not send the email to the selected email address. I spoke to the host about switching the php.ini settings but it still is not working correctly. It is hosted on a linux platform. I need some help to get this working.

My code is correct. When I tested the form on my local server it sends to the correct address, but when its uploaded to the server the mail does not send. Any help would be appreciated
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 100
Reputation: petr.pavel is an unknown quantity at this point 
Solved Threads: 14
petr.pavel's Avatar
petr.pavel petr.pavel is offline Offline
Junior Poster

Re: Same Problem

 
0
  #8
Feb 16th, 2009
Hi there,
since you don't have a control over the server there's nothing you can do to in order to make the default mail() function work.

To be really really sure create a file with just one line:
  1. mail('your@address.com', 'this is a test', 'test body');

I have been sure so many times and yet I was proven wrong later. So it's best to make your tests as simple as possible.

If you get the test message when run on your dev box but not from the production server you should give this script to the hosting company and tell them to fix their setup.

If they tell you to screw yourself you'll have to work around it. Consider using some mail() replacement like the excellent XPertMailer:
http://xpertmailer.sourceforge.net/
You can switch it to use a direct SMTP connection instead of default mail() function. For that case you will need to know what's your hosting's SMTP server for outgoing connections. Or you will have to use some other SMTP server, likely with SMTP authentication turned on.

XPertMailer has one additional feature and that is to connect to SMTP server of the recipient domain. That way the e-mail is sent through different SMTP servers, no need to use your own SMTP server.

Petr
Petr 'PePa' Pavel

The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 6
Reputation: jprahst32 is an unknown quantity at this point 
Solved Threads: 0
jprahst32 jprahst32 is offline Offline
Newbie Poster

Re: Set server settings...yes or no?

 
0
  #9
Feb 16th, 2009
Thanks for the help. Good idea
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC