It's very common for people to want to send binary attachments (e.g. jpgs, etc). So you need to open the file as a binary file, not a text file. If you're not familiar with this, here's some info on the subject: http://wiki.answers.com/Q/What_is_the_difference_between_binary_file_and_text_file_in_c_language