I'm building an application using a proprietary programming language that is similar to C. The programming language includes a built in send mail function, however it is very limited. I am limited to string sizes of 65535 characters by the language itself. In addition the function does not support sending attachments. The length should never be an issue due to the data I wish to work with, however I would like to be able to send data in the form of a tab-delimited .xls type attached file, as opposed to plain text in the body of the email itself.
To do this the data must be encoded using base64, which I understand and can do without a problem. Ok, So I have my .xls file, it's been converted to base64 and it's ready to send. Now what? If I paste it as is in the message field, I am assuming it will be sent out in it's encoded form as plain text and there will be no mechanism to recognize the data as MIME encoded on the other end and will be jibberish ASCII on the receiving end, and not as an attachment.
Is it possible to include the MIME header information in the actual message field of the email so that the data may be decoded as an attachment on the other end? I'm going to take a wild guess and say no with the little information I can deduce about SMTP protocol. I believe that the attachment data resides outside of the message header, but this is my question. And If so, that means I am unable to transmit attachment data using the built-in send mail function provided by the programming language. In which case I would need to reconstruct the entire SMTP packet by hand to place the encoded data in the correct place with the proper header. The problem is I have not been able to find an SMTP API anywhere so that I can create my own "sendmail" function, which I would love to be able to do. I can manually establish the socket connection to the mail server, I just don't know the format SMTP uses so that I can construct the packets. Can anyone point me in the right direction?
To do this the data must be encoded using base64, which I understand and can do without a problem. Ok, So I have my .xls file, it's been converted to base64 and it's ready to send. Now what? If I paste it as is in the message field, I am assuming it will be sent out in it's encoded form as plain text and there will be no mechanism to recognize the data as MIME encoded on the other end and will be jibberish ASCII on the receiving end, and not as an attachment.
Is it possible to include the MIME header information in the actual message field of the email so that the data may be decoded as an attachment on the other end? I'm going to take a wild guess and say no with the little information I can deduce about SMTP protocol. I believe that the attachment data resides outside of the message header, but this is my question. And If so, that means I am unable to transmit attachment data using the built-in send mail function provided by the programming language. In which case I would need to reconstruct the entire SMTP packet by hand to place the encoded data in the correct place with the proper header. The problem is I have not been able to find an SMTP API anywhere so that I can create my own "sendmail" function, which I would love to be able to do. I can manually establish the socket connection to the mail server, I just don't know the format SMTP uses so that I can construct the packets. Can anyone point me in the right direction?