On Sunday 21 October 2001 06:45, Luditus wrote: > Hi Fokes, > > I would like to send an mail via the mail function. > > If the mail failes I would like to redirect to an errorpage. > Currently my code looks like this: > > if ( mail($email,$subject_confirm_account, > $message_confirm_account, $from_confirm_account) ){ > HEADER("Location:index.php?fuseaction=txt&msg=registered"); exit; > //success } > else{ > HEADER("Location:index.php?fuseaction=txt&msg=mailproblem"); exit; > // mail could not been sent > }; > > Unfortunatelly I get an erromessage like that: > > Warning: Failed to Connect in > e:\projects\globosapiens\07_production\actual\account\include\ >user.php on line 256 > > Warning: Cannot add header information - headers already sent > by (output started at > e:\projects\globosapiens\07_production\actual\account\include\ >user.php:256) in > e:\projects\globosapiens\07_production\actual\account\include\ >user.php on line 260
Try calling exit right after sending those Headers. Somehow the script is sending header information before your HEADER calls above. Do you have any output prior to that if block? Even an html dtd will do it. HTH, Jesse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]