How to access smtp.gmail.com or other to send email

This is a very useful thread, thanks to all. I got stuck with an error message saying that I wasn't allowed to send messages to SMTP2GO as I didn't have a senders domain. This is apparently a new security feature of SMTP2GO. Here's the steps to take to get it working:

  1. Create account at https://www.smtp2go.com/
  2. Add your email address as a user. Note that each user has their own passwords (separate to the admin account created above).
  3. To get around the recent issue of needing to have your own sender domain, which is a problem if you want to use say a gmail or ISP issued email address: Make contact with SMTP2GO Support and explain your use case, and they will adjust your account appropriately. This way you can keep Sender Domains blank. If you try and enter a sender domain that you don’t own, you’ll receive the error message “The domain you have entered is not allowed. Please note that you must have control of the DNS of any domain that you add.” (To check if this issue is occurring, open the serial monitor before code execution, and after “235 Authentication Succeeded” you will see an error “That user is not allowed to send”).
  4. Restrict senders to your chosen email addresses – this provides some level of security against spammers.
  5. Incorporate the code at Arduino - SMTP2GO into your Arduino sketch.
  6. The username and password must be sent using base64 encoding by the Arduino to SMTP2GO. You can use https://www.base64encode.org/ (amongst other sites) to do the encodes. (To check if you got the password right, open the serial monitor before code execution and look for “Sending Password”. The next line should say “235 Authentication succeeded”. Otherwise, check you've got the right password and done the base64 encoding correctly).