My apologies if I misstate something or use an incorrect term. But I was trying to figure out how to use an if statement on an object.
This works just fine and as I understand it, the @ suppresses errors.
if (@mail("$receiver_email", "$subject", "$message", "$headers")) { }
However If I do this it fails:
if (@$mail->send('email@gmail.com', "$receiver_email", "$subject", "$message")) {}
The irony is that the email goes through but the IF fails. How can I fix the IF statement so it works properly?