I need to find what’s wrong either with my script or the PHP.ini settings for sending a mail but I don’t know how to see the error messages generated by the server.
I looked at PHP.ini and there are two directives to handle errors:
display_errors
log_errors
If display errors, where does it displays them. I already enabled it and I don’t see them.
server restart needed to changes take effect
you can check real values by running phpinfo() function in the “Local value” column
also check error_reporting directive
If log_errors, where can I find the log archive?
web-server’s error log unless other destination assigned in the error_log directive
Don’t apologize, your questions is all right.
your web-server (Apache usually) have two log files - access log where all visitors recorded, and error log, where all errors logged.
The path to the log file is vary, depending on the server softvare and operation system
O.K. Could you give me any hint on how to find the log error file? I’m using PL Wamp on Windows.
If not, when I change display_errors to on, I can’t see the errors beacause, I think, the error happens when Submitting and it starts another page immediately. So, I think, the error message appears in the page where it occurs while I’m already in another page. Can I stay in the same page even after Submit or can I “move” the messages to the new page?
There’s a port 25 that I don’t know if I have to change. I already tried with port 567 and port 465, and nothing happens.
Everthing seems to be o.k. but when I check for my message at myadress@gmail it doesn’t appear. So, either the message is not being sent or it’s send somewhere else?
"1.In your email client software, under Outgoing mail, set the SMTP server to smtp.gmail.com.
2.Set the your username is yourgooglemailname@gmail.com and make sure “Use username and password” is checked.
3.Also check off “TLS” under “Use secure connection.”
And voila! You can send mail for any email address from any network (that lets you connect to an outside SMTP server) using your Gmail account - be sure to enter your Gmail password when prompted.
Check out Gmail’s help section on POP access for Gmail for specific instructions for setting this up with your email program. If you only want to use the SMTP server, skip the POP bits and only set up SMTP to work with your existing email account."
END OF QUOTE
I know you’re going to LOL but, what’s “my client software”
Well, it makes sense.
Now I suppose the error is occurred on the page that loads after you press submit button.
So, you should be able to see it, unless it commands browser to load another - the third page.
You can prevent it by putting die; command right after mail() or by commenting out all lines that contain header() function.
As for the email. you merely cannot use mail() function under windows.
And your client software must be some script, like phpmailer
The book includes the PHP script that is supposed to send the mail. If there’s a scrpt already made, there has to be a way of implement it. In the same book it gives you the instructions to change the lines on PHP.ini:
smtp
and
mail_from
for a windows environtment. So, what’s so wrong. If I can’t use gmail, there has to be another smtp that works with these instructions, don’t you think?
Adding the library that you suggest seems to me very complicated. I mean I really appreciate the fact that you told me that it’s never going to work with gmail, but then why not another smtp?
ThanK you, but if I left everything for some other time (when I know more) then I’ll never get it done.
My problems have always been related to the instalation or the selection of the software that I use rather than the programming itself. So, if I have to learn something, it is more a matter of understanding how the different parts of sofware can be integrated. What system, programm, library, smtp, WAMP, installer, etc. etc. etc. goes better with what.
Besides, I already have all the Scripts that I’m going to need (almost). I already have the Stylesheet. and the HTML forms ready to add whatever instructions that use PHP. If I can get the PHP to work, then I’ll try to integrate it with the DB. And that, of course is going to be another session of learning about configuration of the data base with all her settings and all its related rpoblems.
Programming is not an issue. Configuring the system is.
Programming is not an issue. Configuring the system is.
You can’t configure your wamp server to use your book email script. That’s all.
Another piece of software needed, not included in wamp - an SMTP server, complicated one.
So, you either have to find another way, or leave it alone.
Sending mail is very simple task and I’d suggest not to focus on this too much