Dealer should be able to sort it with just the VIN code. Be prepared to fork out around $500.
I personally couldn't justify that so found a DIY solution.
AK90+ module off Aliexpress - $30
Blank key off Aliexpress - $10
Get a locksmith to cut the key - $30-50
Install the software that came with the AK90+, unbolt the EWS module from the car, an hour max fiddling around and you've coded yourself a new key for under 1/5th of the price.
1998 E36 should be EWS 2 so will be compatible. Plenty of easy to follow guides out there. Turned out a much easier process than I had feared. Just have a go.