Solved

Attachments with smtp clients..

Posted on 2000-04-10
2
286 Views
Last Modified: 2010-03-30
I've developed a smtp client.  I'd like to know how can i send the attachments? The attachments cna be a file of any type..
0
Comment
Question by:jeet1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
misos8 earned 25 total points
ID: 2704710
Hello jeet1,
Inorder to send an attachement using the SMTP.
Here is the step.

1)After the "DATA" command is written out, u will need to send out the information of the MIME version . Like "MIME-Version: 1.0"

2) Then define the content type and the boundary for the data to be send as
"Content-Type: multipart/mixed; boundary=\"" + strboundary +"\"")"    where strboundary is some temporary string set as "abcdef"

3) End the header information and start ur information as
"\r\n--" + boundary"

4) Then start ur body part which is in text as
"Content-Type: text/plain; charset=\"us-ascii\"\r\n""

followed by the data in the body part.

"This is great\r\n\r\n"

end the body with the bounbary that u have defined
""\r\n--" +  strboundary"

5) Now the specifyfor the attachement as

""Content-Type:image/gif; name="+FileName" where FileName is the name of the attachement which the recipient will see as. Content type will be dependend on what u want to send it. It it is binary encode it.

6) U will then specify that u want as attachement else it will show up as part of the message.

"Content-Disposition: attachment;filename=\""+FileName+"\""""

7) U will specify the type of encoding as
"Content-transfer-encoding: base64\r\n"  

8)Then u will write the encode as
"QORIUEQRUQUREQOQUQU" etc

9) And incidate that u have ended the file as
""\r\n--" + strboundary"

10) Then specify the overall end of the message as
""\r\n\r\n--" + strboundary + "--\r\n""

11) Then specify the end of it by
"."

12) Then close it using
"QUIT"

Hope this answers ur quesiton.

Misos8.
0
 
LVL 5

Expert Comment

by:mbormann
ID: 2708875
listening...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question