'Set the sender
Route the message'

def _compose_onvalidation(self, form):

    post_vars = current.request.post_vars
    settings = current.deployment_settings
    if settings.get_mail_default_subject():
        system_name_short = ('%s    -    ' % settings.get_system_name_short())
    else:
        system_name_short = ''
    if settings.get_mail_auth_user_in_subject():
        user = current.auth.user
        if user:
            authenticated_user = ('%s    %s    -    ' % (user.first_name, user.last_name))
    else:
        authenticated_user = ''
    post_vars.subject = ((authenticated_user + system_name_short) + post_vars.subject)
    contact_method = post_vars.contact_method
    recipients = self.recipients
    if (not recipients):
        if (not post_vars.pe_id):
            if (contact_method != 'TWITTER'):
                current.session.error = current.T('Please    enter    the    recipient(s)')
                redirect(self.url)
            else:
                if current.msg.send_tweet(post_vars.body):
                    current.session.confirmation = current.T('Check    outbox    for    the    message    status')
                else:
                    current.session.error = current.T('Error    sending    message!')
                redirect(self.url)
        else:
            recipients = post_vars.pe_id
    if current.msg.send_by_pe_id(recipients, post_vars.subject, post_vars.body, contact_method):
        current.session.confirmation = current.T('Check    outbox    for    the    message    status')
        redirect(self.url)
    else:
        if current.mail.error:
            current.session.error = ('%s:    %s' % (current.T('Error    sending    message'), current.mail.error))
        else:
            current.session.error = current.T('Error    sending    message!')
        redirect(self.url)
