| | |
Set server settings...yes or no?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
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.
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
~ Confucius, The Confucian Analects
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.
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.
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.
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 =
[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
~ Confucius, The Confucian Analects
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:
then uncomment the sendmail_path row and enter the full path incl. the switches. For example:
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.
bash Syntax (Toggle Plain Text)
locate sendmail
ini Syntax (Toggle Plain Text)
sendmail_path = /usr/sbin/sendmail -t -i
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.
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.
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.
If your question is solved then mark the thread solved. If someone gives you good advice then give them some rep.
Hey,
Thank You Petr 'PePa' Pavel, it worked like a charm...
Thanks All..
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
~ Confucius, The Confucian Analects
•
•
Join Date: Feb 2009
Posts: 6
Reputation:
Solved Threads: 0
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
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
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:
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
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:
php Syntax (Toggle Plain Text)
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.
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.
![]() |
Similar Threads
- OS 10.4 2 Win2k server problem (OS X)
- cannot find server or DNS error (Web Browsers)
- Problem setting up mail server (PHP)
- Cannot get CF set up on server (ColdFusion)
- IE stopped working but OE, Media Player Radio etc does work (Web Browsers)
- outlook XP, wireless (Networking Hardware Configuration)
- Set Performance Options in Windows XP (Windows tips 'n' tweaks)
- messenger problem (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: A problem with date and mysql query
- Next Thread: php form linux settings for php.ini
| Thread Tools | Search this Thread |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validation validator variable video web xml youtube





