How to send exe file in gmail

I wanted to send an executable (.exe) file as email attachment from Gmail to a friend of mine who also has Gmail. Unfortunately, it is not letting me upload this executable file. I also cannot send this file when I compress it as a zip. I learnt that Gmail does not allow exe files. Can you help?
Akshay

Gmail will not let you send and receive executable files as email attachments. Google does this to protect their servers and, I suppose, the users’ computer. And, yes, even if you cloak it as a compressed zip file, the .exe will still not be uploaded on Gmail. But I could manage to do this successfully!

Sponsored Links

Before I describe my little experiment by which I was able to send a 2.5MB executable file as an email attachment through Gmail, I should tell you an alternate way to do this. Simply upload the file on your own server or one of the free file hosting sites (if they allow). You can then forward the URL to the recipient. But if you aren’t satisfied with this and want the real deal… here is how it is.

How did I send an executable file over Gmail as an email attachment?

I started with a 2.5MB exe file. This was a small setup file of a program I had downloaded from the web. As you can see, the file size was way below the Gmail email attachment size limit.

My assumption that Gmail is recognizing an executable file by its file extension worked! Thus, knowing that the executable file will be rejected (it had a .exe extension), I simply changed that!

Read how to change the file extension in Windows 7 if your computer is running that operating system; a similar logic will work for older versions of Windows O.S. People who know a little DOS can use the RENAME command via the terminal window (command prompt) and accomplish the same. The format of RENAME is:

> rename OLD-FILE-NAME NEW-FILE-NAME

FYI, you can also use ren instead of rename. Generally, you would just substitute the .exe file extension to something like .doc – this is what I did.

You can then upload and send the executable file as an email attachment via Gmail. And do remember to instruct the recipient to change the file extension back to exe!

Sending executable file through Gmail in Windows

For obvious security reasons, Google will do anything that is in their power to stop you from sending .exe, .apk and other executable files as email messages’ attachments. But, sometimes it is very needed to send such file (in a completely legitimate scenarios). And doing so in Gmail becomes a serious task.

This is, because simple encrypting (password-protecting) such files isn’t enough right now. Since password-protected files encrypts their content only and thus list of attached files is available. Gmail can scan such file and learn that you’re trying to send an executable file even without knowing the password.

Simple extension rename: .exe –> .nothing also doesn’t work today. Google is somehow able to check mime-type of files attached in encrypted archives and doesn’t rely on file extensions anymore.

Assumptions

Linux comes to the rescue here, with its .tar (tarball), .gz (gzip) or .tgz (gzipped tarball) archive formats. They must be, in addition, compressed again, to password-protected .zip format (or any other archive type that supports encryption).

Actually, any type of archive would do, for first-pass compress, not just Linux types, but the additional assumption for my (old-time Windows user and Total Commander lover) was to figure out solution that:

  • Is acceptable by Gmail (i.e. attached file isn’t rejected as insecure)
  • Can be achieved using Total Commander without plugins

For the second point all other extensions fails, because Total Commander can pack only .tar, .gz, .tgz and .zip archives internally. For any other supported packer, plugin is needed (can unpack any listed type of extension without plugin):

How to send exe file in gmail

Solution

The correct sequence is:

  • Pack your .apk, .exe or any other executable file using .tar, .gz or .tgz archive types (first pass)
  • Pack resulting archive using password-protected .zip files

How to send exe file in gmail

Why is this working

When you read the articles linked in the introduction (this one and this one) you’ll learn that:

  • Only contents of packed files are encrypted, list of files — no.
  • Gmail can check the extension of a file inside an encrypted archive without knowing the password
  • It can also check mime-type, so renaming file to have some weird extension doesn’t work

However, if you pack an archive inside another archive and that overlying archive is encrypted then Gmail cannot access the second archive (inside the first one), because it is an encrypted content. Accessing it would require Gmail to know the password that was used to encrypt the first archive.

Why is this working on .tar, .gz or .tgz archive types, but not on .zip (you can pack exe into .zip and then that .zip into another (encrypted) .zip and Gmail will prevent sending such attachment) — I don’t know.

Summary

Gmail will prevent you from attaching executable file:

  • By itself (.apk, .exe etc.)
  • With changed extension (.gmailsucks)
  • With or without changed extension, packed into .tar, .gz or .tgz archive (encryption not supported)
  • With or without changed extension, packed to encrypted .zip file
  • Packed into (encrypted or not) .zip archive and then packed into another .zip (encrypted or not)

It will fail (i.e. it will allow you to attach executable file packed into .tar, .gz or .tgz archive and then resulting archive packed again into encrypted .zip archive.

Can you send .exe on Gmail?

Most email providers, including Gmail, don't allow you to send executable or ".exe" files. Executable files are programs that require the action of a user to install.

Can .exe be sent as an attachment?

Any unsafe attachment like *. EXE is blocked by the mail server. Unsafe attachment even being compress/zip is blocked by the server.To send mail with this kind of attachment, the sender is suggested to rename the file extension (e.g. rename .exe to . bak).

How do I share an EXE file?

For example, you might rename program.exe to program. exe_ok, and then attach the file to the e-mail message. You can include instructions in the message for the recipient to save the file with the correct name, program.exe. I renamed the exe file I wanted to send to XXXX.