Re: isset function problem

From: Date: Thu, 10 Jul 2003 14:21:07 +0000
Subject: Re: isset function problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-154735@lists.php.net to get a copy of this message
... or: if(!empty($SenderEmailAddress)) { ... } Dean E. Weimer wrote: > What about the rest of the code? How is this variable defined? I > have had this happen in some code before, I found that the variable > was set to "". Try using: > > if (isset($SenderEmailAddress) && $SenderEmailAddress != "") { > mail($mailTo, $mailSubject, $Message); > } > >> I have the following code : >> >> Quote: >> >> if (isset($SenderEmailAddress)){ >> mail($mailTo, $mailSubject, $Message); >> } >> >> Unquote >> >> All I want to do is that , if the $SenderEmailAddress is not >> entered, the mail() function should not run. However, >> if the $senderEmailAddress variable is not set, the error I get is >> "No recipient addresses found in header " >> >> Can someone help and tell me why I get this error? >> >> Thanks >> Denis >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#154735) next »