Like we'll see in the next Sponsorships section, the best practice with contacting a venue is to start with a **brief **email, see if they're interested in learning more, and try to get them on a phone call to discuss more. Even if you keep it all to email, keeping your initial message brief will help you avoid scaring people off by overwhelming them with details when they're not sold on the concept.
Here's a great sample initial email:
Hi [name],I'm helping put together a coding event for high school/college students in [city] on [date], CodeDay. It's a 24-hour non-profit event to inspire students to get interested in coding.
I know [company name] has an office locally, and I wondered if hosting the event would be a possibility? Do you have any time in the next week to talk about what's involved, and whether that's possible?
Getting a venue is very similar to getting a cash sponsor: you're asking a company to trade a resoure they have (a space, and possibly employees to oversee it) for some benefits (helping the community, etc). Accordingly, you can read a lot more on what makes a successful email in the Sponsorships section.
Once you've established that the venue is interested, you can offer them a flyer which answers a lot of common questions here.