By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,562 Members | 1,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,562 IT Pros & Developers. It's quick & easy.

SMPT tag to send encrypted file

100+
P: 180
Hi guys,
I have a plain text file. I want to encrypt and send this file via mail. I use SMTP to send the file over network. I'm able to send the file in plain text but if I encode and send it, I get some stupid data. I make use of base64 to encode the file. Here is the tags with data that I send to mail server.

Expand|Select|Wrap|Line Numbers
  1. MIME-Version: 1.0
  2. From: abc@gmail.com
  3. To: xyz@yahoo.com
  4. Subject: Hi
  5. Content-Type: multipart/mixed; boundary=unique-boundary-1
  6.  
  7. --unique-boundary-1
  8. Content-Type: text/plain
  9. Content-Transfer-Encoding: base64
  10. Content-Disposition: attachment;filename=fileName
  11.  
  12. 8  4  0   6  6  0  0  0 0     5.943         1 0 1
  13. 8  0  0   6  23 0  0  0 0     6.289       0.4 0 1
  14. 8  0  1   15 0  0  0  0 0     4.557         1 0 1
  15. 8  0  1   16 0  0  0  0 0      4.21         0 0 1
  16. 8  0  1   17 0  0  0  0 0     1.039         0 0 1
  17. 6  4  0   1  1  2  18 0 0     5.943       0.6 0 1
  18. 6  2  1   8  8  16 0  0 0     3.864       0.6 0 1
  19. 6  2  1   7  7  9  0  0 0     3.518       0.4 0 1
  20. 6  2  1   8  10 10 0  0 0     3.171       0.6 0 1
  21. 6  2  1   9  9  11 0  0 0     2.825       0.4 0 1
  22. 6  2  1   10 12 12 0  0 0     2.478       0.6 0 1
  23. 6  2  1   11 11 13 0  0 0     2.079       0.6 0 1
  24. 6  2  1   12 14 14 0  0 0     1.732       0.4 0 1
  25. 6  2  1   13 13 17 0  0 0     1.386       0.6 0 1
  26. 6  0  1   3  16 20 0  0 0     4.557       0.6 2 1
  27. 6  0  1   4  7  15 0  0 0      4.21       0.4 1 1
  28. 6  0  1   5  14 21 0  0 0     1.039       0.4 1 1
  29. 6  0  2   6  19 0  0  0 0     5.596       0.4 0 1
  30. 6  0  2   18 20 0  0  0 0      5.25       0.6 0 1
  31. 6  0  2   15 19 0  0  0 0     4.903       0.4 0 1
  32. 6  0  2   17 22 0  0  0 0    0.6928       0.6 0 1
  33. 6  0  2   21 24 0  0  0 0    0.3464       0.4 0 1
  34. 6  0  3   2  0  0  0  0 0     6.635       0.6 0 1
  35. 6  0  3   22 0  0  0  0 0         0       0.6 0 1
  36.  
  37. --unique-boundary-1--
  38. .
Is there anything I'm doing wrong.. Please help me to solve the problem.

Thanks
Jul 10 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
Probably, you need to send the encrypted file as binary rather than text.
Jul 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.