You are here: mail() only works when connected to mysql « PHP Programming Language « IT news, forums, messages
mail() only works when connected to mysql

Posted by Wessman on 08/29/06 06:31

sending mail using function mail() only works when I'm connected to
mysql.

<?
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
mysql_connect()".

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?

My setup:
FreeBSD 6.1-RELEASE-p2
Apache/1.3.35
4.1.18-log
PHP 4.4.2

'./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'
'--with-freetype-dir=/usr/local' '--with-pspell=/usr/local'

php ini
sendmail_path /usr/sbin/sendmail -t -i
SMTP localhost
smtp_port 25

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация