BPM - 4GL email code


This is first time I have done this so don't know where to start. I wondering if anybody would be so kind to let me have some example code to send an email. I need to look up other tables not in bo , so I am thinking that I need to do it by 4gl. BAM doesn't reference the tables I need.