Email attachments from arduino as an SMTP client

Interesting problem. Obviously, the hardest part is to build the SMTP client state machine that implements something like section 4.2 in RFC 3030 (see link in reply by ManicDee). Assuming your SMTP server supports chunking, then all you have to do is the following:

  1. Get the binary data of the image file as a stream of octets (bytes)
  2. Invoke the state machine and follow the protocol (plus whatever cleartext auth needed) up until the BDAT part
  3. Issue a BDAT for the size of the binary data (or send them in chunks)
  4. Blast the binary data across the wire.
  5. Issue a BDAT 0 LAST
  6. Wait for confirmation of all data chunks, issue QUIT and close the connection.

You should be able to find C-based SMTP client code in the open-source realm and adapt it for the Arduino. In any case, sounds like quite a bit of work. Also, I would imagine it would be very, very hard to build an SSL stack on the Arduino.

Just my 2 cents' worth from a backseat commentator. :slight_smile: