Helping people with computers... one answer at a time.

Gmail and other mail programs or services will often block attachments using file types frequently used by malware. I'll show you how to send them anyway.

Can I get Gmail to send executable file attachments; if I can, how do I do so?

Yes. There are actually a variety of ways, so I'll cover a couple of the most common.

The good news is that they tend to work regardless of what email service (Gmail or anything else) that you use.

I'll also explain why Gmail might block this type of attachment and how even the workarounds are fairly secure.

Let's say that I want to send a copy of procexp.exe to someone as an attachment. (Side note: This is an example only - the proper way to get procexp.exe is to download it from Microsoft.)

Gmail's block of an attempt to send an executable file

As you can see, it's blocked because Gmail recognizes that ".exe" is an executable file.

We're going to have to trick Gmail.

Rename the file

The first approach is to simply rename the file that you're attempting to send or make a copy with a different name, making sure to change the extension. So procexp.exe, which we see Gmail blocking above, might be renamed to "procexp.leo", as ".leo" is not an extension that indicates an executable file.

Gmail with a renamed attachment

You'll need to include instructions for your recipient to save and then rename the attachment back to its original name in order to use it.

Zip the file

Another approach is to use a zipping utility like WinZip, or my favorite, 7-zip, to create a ".zip" archive that includes the file you want. An additional benefit is that you can include more than one file in the archive and the archive will typically be compressed to be smaller than the original file.

Gmail sending a .zip

Whoops...

Gmail blocking a .zip containing a .exe

While this technique works with many mail systems, Gmail is smart enough to peek inside the .zip file and notice that there's a ".exe" file within. As a result, it blocks the send.

Because I use 7-zip, I'll create a ".7z" archive and send that instead:

Gmail sending a .7z archive

That worked. In this case, you would then instruct your recipient to get 7-Zip if he or she didn't already have it and use it to extract files from the archive.

Rename the zip

Finally, ".zip" file format is probably easier for most, as support for it is built into Windows. So instead of using an alternate archive format, I'll just create the .zip as I did above, but rename it before I send it:

Gmail sending a .zip file renamed as .leo

Note that I used the same non-executable file extension, ".leo" as I did before. It doesn't matter what you use as long as it's not one of the file extensions that your mailer might consider to be an executable program, like ".exe".

And once again, you'll need to instruct your recipient to rename the file from ".leo" (or whatever you choose) to ".zip" so that they can then access the contents.

What's the security issue, anyway?

What Gmail is attempting to protect against is that malware often propagates as executable attachments. The net effect is that many email systems simply block emails that contain them. Even if you had been able to attach your ".exe" file, it's extremely likely that your recipient's email program may have prevented him from being able to access it.

Forcing you to jump through a few hoops to send the file as something that is not immediately executable forces your recipient to have to take extra steps to actually run the program. They can safely adhere to the "never, ever, run executable attachments" rule, while still being able to accept executable files from you.

And they're forced to think about it before they just run whatever they recieve.

Finally, I do have to add that because of malware and the general advice to not open any attachments, even from people you do trust (due to email account theft and hijacking) - you might just want to consider an alternate approach to getting an executable file from point A to point B on the internet. Perhaps using one of the several services, like DropBox, which allows you to share files securely and privately.

Article C4853 - June 22, 2011

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
10 Comments

@ask leo. "Finally, I do have to add that because of malware and the general advice to not open any attachments, even from people you do trust "

Me:If you open within a sandbox ..no harm will be done even if the attachment is infected .After you close the sandbox everything is safely deleted.
Jp

Posted by: johnpro2 at June 30, 2011 3:14 AM

Leo, you wrote:

"Actually, it may not. Password protecting the zip doesn't hide the list of files contained in the zip, and if Gmail uses the filename only, then it has what it need to determine that there's a .exe in it - passworded or not."

Indeed: zipfiles list their contents in a header which serves as a "table of contents" which isn't necessarily encrypted.

If this proves to be an issue, first unencrypt the zipfile if it was encrypted (since encrypting it didn't hide the filenames) and rezip it unencrypted. (If it wasn't encrypted to begin with, then obviously there's no need to rezip.)

Next, zip the first zipfile inside a second, encrypted  zipfile. This second zipfile should  encrypt everything within it, this time including  the filenames within the first zipfile, which aren't a "table of contents" anymore, but are now simply file data.

A lot of trouble, I know -- but it should work...!

Posted by: Glenn P. at July 5, 2011 10:03 AM

Yes Leo, I have used the rename for years on gmail. I always rename to *.jpg. You just need to inform the other person if it is an .exe, .zip etc.

Great minds think alike. :)

Posted by: Ed B. at July 19, 2011 8:20 AM

This alone is reason for me to abandon my gmail account. As more and more programming is devoted to non-advanced computer users, I find the nanny-ism and "convenience" features to be really bothersome.

Posted by: Jeff J at March 18, 2012 10:09 AM

we can send exe files by using winrar instead of winzip or sending them without compression.

Rashid {URL removed}

Posted by: Rashid Mehood at May 1, 2012 7:01 PM
Post a comment on "How do I send a .exe file if Gmail won't let me?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...