Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- mail() only works when connected to mysql
August 29, 2006, 6:31 am
rate this thread
sending mail using function mail() only works when I'm connected to
mail($to, $subject, "before mysql_connect()", "From: $from");
mysql_connect("localhost", $username, $password);
mail($to, $subject, "after mysql_connect()", "From: $from");
The above code results in a single e-mail containing "after
I don't have a clue of what could be wrong or where to start looking.
I've upgraded the OS, but it didn't help.
Can someone help me figure out what might be wrong?
'./configure' '--with-apache=../apache_1.3.35' '--with-openssl'
'--with-gd' '--with-mysql' '--enable-trans-sid' '--enable-track-vars'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib=/usr'
'--enable-mbstring' '--enable-ftp' '--enable-exif'
sendmail_path /usr/sbin/sendmail -t -i
Re: mail() only works when connected to mysql
Does your smtp server require outgoing authentication, possibly the
mail is failing because no creditentials were supplied and after you've
connected to mysql its using the same creditentials as specified for
that. either way.. check your syslog for error messages it should tell
you exactly what the issue was.