I was having trouble setting the return-path: with the mail() function, so I went straight to the server program.
$fp = popen('/usr/sbin/sendmail -f'.$fromaddress.' '.$toaddress,"w");
The problem is that if the $toaddress contains a name (example: jer<jer@brain-candy.org> ) The mail will not go through with this method even though it works with the mail() function.
Is there some way to stick the name in the header or another way to put it so that it will go through AND retain that name (which is necessary in this case)?