in reply to Skip a line

A couple of points on style ( since the answer is already provided ):
  1. use strict

  2. You seem to be setting $toemail and $fromemail as global variables - you should consider scoping them as lexicals, and passing them explicitly to the function: emailme( $fromemail, $toemail ). This will make your code much easier to debug.

  3. Consider using join in your print statement:
    print DATAFILEOUT ( join '|', $company_name, $time, ... ); This also helps avoid typos, and lets you add and remove parameters more easily.