SMTP errror handling

When I try to send the email with invalid recipient like
[email protected] I get following error 550 unknown recipient. I try
to catch the error with begin and catch but error is not caught.
Any idea

If you want to rescue an exception you need to use rescue, not
catch( which is something rather different in ruby)

Sent from my iPhone

Sorry I mean rescue but I type catch. My code is like this

UserMailer.deliver_sent_to_friend(from,recipient, subject, message)

flash[:notice] = "Message sent."

flash[:notice]=“Message not sent”

However problem persist.

On Aug 4, 4:52 pm, Frederick C. [email protected]