PHP & MY SQL - mailfunction
am 04.09.2006 12:31:43 von ghinzdraHi
I endeavor to implement a newsletter for my association . Here's my
situation : i use the classical duo PHP-MySQL in localhost for the moment
.. Considering the inscription in MySQL part , there's apparently no
problem . I use 2 pages PHP : one for the inscription itslef , another
one for heralding the success of the inscription process. The MySQL
database (prim) is successfuly changed : the table(lettre) has a single
field (mail) which displays the email adresses of the 2 emailboxes that i
filled in the form.
However as for the sending part there happens to have a problem . I
currently use 2 pages : a hmtl page (envoi.html) for the writing of my
newsletter and a php page for the sengin part itself (mail.php). The SMTP
key in the php.ini file is valued "localhost" . In the beginning the
following error message was printed by the browser :"Warning: mail():
Failed to connect to mailserver at "localhost" port 25, verify your
"SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\www
\newsletter\mail.php3 on line 48" . I guess i could not expect another
anwser seiing no SMTP server was installed at the localhost scale . I
activated Hamster that i'm used to carry out only for getting news on
Usenet for it seems to me that it offers a SMTP function (if i'm wrong
tell me so) . There was no hint of a mail in those emailboxes yet
(laposte.net and hotmail.com) .
So i have a single question and three ideas : where does it fail ?
1- is it at the MySQL level ? (even if the datas are correctly displayed
in the table itslef maybe the values are not put in the right place in
the PHP mail function )
2- is it at the PHP level ,more precisely is the mail function the
culprit? if it was so then an error message should be impressed in the
browser
3- is it at the SMTP level ? is Hamster ill-configured or unable to
carry out this task ?
Thanks , i hope that you were able to understand me
i put the code of the 2 pages
POUR LA PAGE HTML de rédaction envoi.html