A goodbye email is sent to co-workers usually on the last day of work in an organisation. It is a good means of expressing gratitude for the learning opportunities you got there.
Like any formal email, it is better to keep a goodbye mail short and to the point. Do not digress unnecessarily. Highlight the positive parts of your work and move forward. You can also mention about projects where you have enjoyed working together, keeping the tone casual here. Humour may also be used, depending on the atmosphere of your office.
While writing the email, a personal touch may be added by mentioning certain co-workers who have guided you in your stint in the organisation. Graciously thank everyone for their support and wish them luck on their future endeavour.You can end the email by adding your contact details so that your colleagues can be in touch with you.