Re: PHP logic - Whats going on here?

From: Date: Wed, 11 Aug 2004 15:32:59 +0000
Subject: Re: PHP logic - Whats going on here?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193457@lists.php.net to get a copy of this message
On 08/11/2004 9:28 AM, Kim Steinhaug <kim@steinhaug.com> wrote: > Thanks for your reply, it all seems logical when you think of it, > still I also think it sounds logical without the extra ELSE statement > since the function has to executed for the first IF to do the comparison, > meaning that the email should be sendt in the first place. (If it didnt > how could it state FALSE or TRUE, unless PHP only simulates the > function if it falls outside the initial IF statement) > > However, no reason to argue the obvious, :D > > On the other hand, this would also mean that the exmaples from > phpmailers homepage are wrong : > > [ SNIP FROM http://phpmailer.sourceforge.net/extending.html ] > $mail->Body = $body; > $mail->AltBody = $text_body; > $mail->AddAddress($row["email"], $row["full_name"]); > $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg"); > > if(!$mail->Send()) > echo "There has been a mail error sending to " . $row["email"] . > "<br>"; > [ /SNIP] > > This is probably why I in the first place removed the extra ELSE statement, > since I didnt see any reason for it. But in future Ill always include it it > seems, :D I've been using PHPMailer like this for years: if (!$mail->Send()) { } You shouldn't need an extra else { }, Jay's reasoning nonetheless. That being said, I don't know why it isn't working for you. Paul

« previous php.general (#193457) next »