How to Use SMTP Using My Mcu

Introduction: How to Use SMTP Using My Mcu

I'm trying to make smtp protocol using my mcu & ethernet(W5500)

Step 1: SMTP(Simple Mail Transfer Protocol)

There are 3 steps for sending e-mail

  1. Establish TCP session with SMTP server (3way handshaking)
  2. Response & Requset SMTP Command
  3. Close the session

SMTP link:

Step 2: Meterials.

Just used W5500-EVB(Ethernet evaluation board) for sending e-mail.

  • mcu: LPC11E36(CM0) included in W5500-EVB
  • etc: MAC address
  • ethernet: W5500

W5500 wiki page:


  • software: LPCxpresso
  • downloader: Flash magic
  • etc: Hercules(Serial terminal) for debug

Step 3: Software

There are 8 functions for send e-mail but you can use 2 functions for use it.

1. SendMail()

  • server = SMTP server address
  • from = your full e-mail address (ex:
  • pwd = password
  • to[] = receiver e-mail address
  • cc[] = receiver e-mail address(carbon copy)
  • subject = subject
  • body = body
  • auth = you can choose 2 options between 'SMTP_AUTH_NONE' and 'SMTP_AUTH_PLAIN'
  • FileAttached = if you want to send some files, you cans choose a option instead of 'FILE_DISABLE'

2. AttachFile()

  • filename = file name (ex: abc.txt)
  • filebody = file body
  • filetype = ZIP, TXT, JPG, BIN
  • Used sntp.h for getting the time.

** I'll upload the entire source code at github and write link after modified a bit

Step 4: Results

I was able to confirm that the CC and txt File arrives.

Be the First to Share


    • Mason Jar Speed Challenge

      Mason Jar Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    2 Discussions