Send attachment on Custom made SMTP server <p>I am currently working on my own SMTP server and I can successfully send email arounds from various programs and web pages such as Outlook, PHP and Pear Mail. </p> <p>The next stage I need to do is to try and send an attachment via my SMTP server. I have tried doing a LAN trace of my server while sending an attachment via PHP to another SMTP server and I can see I get the follwing from the client:</p> <pre><code>DATA fragment, 661 bytes </code></pre> <p>I'm not sure if this is related to the attachment or not. </p> <p>If it is, is this just telling the SMTP server how long the file is and then I should just write a base 64 encoded string onto the network stream and write it to a file to be used for sending the email on. </p> <p>Thanks for any help you can provide. </p>