Jump to content

mail function problem


jimfog

Recommended Posts

I am trying to use the mail function to send a mail-all done in localhost environment. So. in essence I am attempting to send a mail to my self. But on calling the mail function I got this error:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Apache24\htdocs\Appointments\Administrator\admin_db_code.php on line 110

What is going on here.C:\Apache24\htdocs\Appointments\Administrator\admin_db_code.php on line 110 is the path of the file where the mailfunction is called...as you see...specifically it is at line 110.

Link to comment
Share on other sites

It's warning you that the message is not configured to be sent with a From: header. You can add headers as one of the parameters in the mail function, and I guess you can set a default value for that in php.ini. You should usually add a From: header, because spam filters often consider mail spam if it doesn't have one.

Link to comment
Share on other sites

Ι got a message saying "cannot connect to mail server"-obviously a mail server is required.Ι got here http://php.net/manual/en/mail.setup.php and it seems the only solution is to install a local dummy server(go to the bottom of the page)UNLESS you have to propose something else.

Link to comment
Share on other sites

Sendmail is not on your server? Have you checked the include path?
Where is the include path? The only "include path" I know is the folder in the Netbeans IDE folder structure related to the project I am currently working.This is the ONLY include path i know.
Link to comment
Share on other sites

I was wrong. You want to find the sendmail_path. Execute the phpinfo() function. The output should have an item called sendmail_path. If not, PHP won't be able to find the sendmail program. Usual values are /usr/sbin/sendmail or /usr/lib/sendmail. Look in those places to see if sendmail is even installed. If it's not installed, find out how. (I don't know; it's normally there by default.) If it's installed, but the path is wrong or missing, change the path in php.ini

Link to comment
Share on other sites

There is(under the Core section) an entry called sendmail_path but in the columns next to it says no value.o So what is next?

Link to comment
Share on other sites

Look in the paths I gave you. See if anything is there. If there is, change php.ini so the path has the correct value. If not, assume sendmail is not installed. If you have physical control over your server, install it. There are other email servers that might be installed, but I've never worked with anything but sendmail.

Link to comment
Share on other sites

the strange is that I cannot even find the directories you are mentioning on my php installation. I really do not know what to assume. These dirs you are mentioning...there are ONLY found if sendmail is installed?Or they are there either way?

Link to comment
Share on other sites

different installation have different location of sendmail binary. Xampp uses INSTALLATION_DIR_OF_XAMPP/sendmail/ where as WAMP does not come with any.What DD was sugesting is probably location of unix server. If you are using any packages check if it comes with sendmail or not. if they come with one you can find the location in their documentation page. If you had custom installation of apache php, sendmail will not be installed. in that case you need to install sendmail manually and use the location of that binary in php.ini

Link to comment
Share on other sites

Yeah. The pathnames I suggested won't work for you. I could have looked again at your first post and known that. Sadly I have no knowledge of WAMP boxes, so I think I'm done with this topic. Good luck.

Link to comment
Share on other sites

No this is not WAMP.XAMP etc...I have installed all the required pieces separately.Meaning:Apache,MySQL,PHP...are installed separately.

Link to comment
Share on other sites

I'm pretty sure sendmail is a Linux thing. If you're on Windows you'll need to set up something different.
Such as... Edited by jimfog
Link to comment
Share on other sites

I went and searched for it on Google and went through a complicated process of installing a program that would simulate Linux's sendmail. This is what I found: http://glob.com.au/sendmail/I remember having some trouble, you need to assign an SMTP server to the program. I simply assigned it to one of my Gmail accounts since it's just for testing.

Link to comment
Share on other sites

I found this too...I will install it and see how things will go.

Link to comment
Share on other sites

Ι solved the issue-I did not need to install something else.I just set sendmail_path = in php.ini No error messages...The problem now is that I do not get the e-mail. In this case, the sender e-mail and destination e-mail is the same. It is the e-mail my ISP has given me.Any ideas what might be wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...