How to check if email was sent by SMTP

I solved the issue with this line:

Var ctx as New WebSessionContext(App.SessionWithIdentifier(CurrentSession)) ''URLConnection class in webapp