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.)

As you can see, it's blocked because Gmail recognizes that ".exe" is an executable file.
We're going to have to trick Gmail.
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.

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.
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.

Whoops...

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:

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.
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:

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 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
@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.
Posted by: johnpro2 at June 30, 2011 3:14 AMJp
Leo, you wrote:
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 AMYes 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 AMThis 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 AMwe 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