Generally, Javid's solution is the one Apple would like you to use. In general, you shouldn't be sending stuff on the sly without the user's knowledge, but if you really need to send e-mail in your application at a time when you can't quit, then it's relatively easy to do if you're comfortable with socket programming. Apple removed the Objective-C mail delivery classes with Leopard, and there's no sendmail program running on the iPhone
AFAIK, so that means you'll need to handle to communication with the server yourself. It's not that hard if you've done socket programming before - SMTP is a simple text-based protocol, but if you're not comfortable with either socket programming or CFNetwork, then you've got a lot of groundwork to cover first.
Remember, though, Objective-C is a superset of C, so if you can find C source code to do what you want, you can probably use it as long as it doesn't rely on any external libraries that don't exist on the iPhone...