469,916 Members | 2,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,916 developers. It's quick & easy.

SMTP tag for attaching a file

180 100+
Hello,
I want to send an email via network. My requirement is to send an encrypted file via email.
I'm able to send plain text files but if I encrypt and send it, the encrypted file is received but I'm unable to open the file from my application. I get error "incorrect password" though I have entered the correct password.

what I did???
1) Using my application encrypted the file using AES::CBC mode (crypto++ lib) say with password "sample123"
2) Send this file by an attachment using this code to SMTP.
Expand|Select|Wrap|Line Numbers
  1. HELO there
  2. MAIL FROM: <removed by mod@gmail.com>
  3. RCPT TO: <removed by mod@yahoo.com>
  4. DATA
  5. Content-Type: multipart/related; boundary=unique-boundary-1
  6. --unique-boundary-1
  7. Content-Type: text/plain; charset=ISO-8859-1
  8. Content-Transfer-Encoding: binary
  9. Content-Disposition: attachment; filename=samp.txt
  10. MIME-Version: 1.0
  11. From: <removed by mod@gmail.com>
  12. To: <removed by mod@yahoo.com>
  13. Subject: samp.txt
  14. //encrypted data.
  15. .
  16. QUIT 
  17.  
3) Received the file at removed by removed by %^*(@yahoo.com.
4) Open the file with the help of my application.
5) Fails to open as the file is modified. Get error as "incorrect password".

My questions:
1) Is the above data that I'm sending to SMTP correct??
2) How can I send an encrypted data over network so that the contents of the encrypted doesnt change...

Thanks in advance..
Jul 9 '07 #1
0 1613

Post your reply

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

Similar topics

5 posts views Thread by Kevin Harrison | last post: by
34 posts views Thread by antonyliu2002 | last post: by
1 post views Thread by Kun | last post: by
3 posts views Thread by Sean Nakasone | last post: by
9 posts views Thread by mmm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.