This quick goodbye message can be sent by email on the event of a friend's departure.
Dear {Recipient},
Just wanted to send you a quick note to say goodbye. I didn't get a chance to speak to you in person before you left, and getting you an actual handwritten letter isn't possible because {reason you're sending an email instead}. But please know I'm sincere when I say I'll miss you, and I hope you find success wherever you're heading next.
Please be sure to keep in touch.
Sincerely,
{Sender}