Jump to content


Photo

Why doesn't mail() work?


  • Please log in to reply
27 replies to this topic

#21 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 01 August 2006 - 01:38 PM

There are some questions that haven't been asked of the OP yet.

1) Is this one a shared hosting machine or one host per machine?
2) Is this your own machine or are you buying (or using) site space, if so who is hosting your site?
3) Which web server software is being used?
4) Windows or Unix/Linux?
5) If this is a Unix/Linux box do you have shell access?
6) Is there a web based interface to the administration end of the host, for example cPanel?
7) What version of PHP?
8.) Have you talked to your Tech Support about looking at the mail logs?

The answers are all relevent to trying to get an answer to your problem.

Ken

#22 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 01 August 2006 - 03:05 PM

I am glad the grace/smite is gone but I would have graced you for that kenrbnsn.

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#23 TerryR

TerryR
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 01 August 2006 - 05:51 PM

Ken,
Here are my answers:
1. I've tried on two hosts, both with many users - does that mean shared?
2. I'm buying site space on one server, but at present trying things out on my college system
3. I don't know
4. My machine is Windows XP
5. n/a
6. Yes, for the site I am buying, but no for my college site
7. 5.1.4
8. Not yet, but I will tomorrow

#24 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 01 August 2006 - 07:56 PM

This may be a stupid question, but what are your setting in php.ini?

SMTP = mail.mailserver.com
smtp_port = 25
sendmail_from = yourname@mailserver.nl

ROnald  ;D
RTFM is an almost extinct art form, it should be subsidized.

#25 TerryR

TerryR
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 01 August 2006 - 10:36 PM

Ronald, I think you might just have cracked it for me. This is what I've got:

SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

It feels wrong to have localhost, but I don't know what to have instead. Could you explain a bit more please?

#26 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 01 August 2006 - 11:40 PM

That depends. If the machine the webserver is running on is also the mailserver, then localhost makes sense.  Talk to the administrators of the webserver about your problem.

Ken

#27 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 01 August 2006 - 11:48 PM

If applicable, just  change your settings:

SMTP = your mailserver
smtp_port = 25
sendmail_from = youruserid@yourmailserver

Ronald  ;D
RTFM is an almost extinct art form, it should be subsidized.

#28 TerryR

TerryR
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 04 August 2006 - 03:02 PM

:) at last!
Thanks to all for your help. I did what I should have done to start with, and went to the FAQs on my webserver host, where it says...

Use the PHP mail function and set the mail from using the following line of code - replacing email@mydomain with the correct domain name.

ini_set("sendmail_from", " email@mydomain ");

...and all is now OK.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users