This is a follow up to this question - Want to create a form filler - is java, jsp, html enough?. I am repeatedly filling a form on a website (Eg. private dentist reservation).
You can get a loop with a the Flow control plugin for Selenium IDE. However, here begins the problem with Selenium IDE. The tool is really meant only for basic interactions - recording, playing, exporting. If you tried to incorporate some complicated logic, it would be very hard, unmaintainable and very often hacky.
If you want to incorporate ... well ... any form of logic, you'll have to use any real programming language you want with Selenium Webdriver. This will enable you to do literally anything - full power of a programming language together with full browser control.
A common practice is to record the basics in IDE, export it to WebDriver in your favorite language, and carry on from there.
You can't do this in IDE. The only way I could think of is to store the text you want to send, record yourself sending a mail via a webmail, then playback it. But please, it's a hack and should not be done this way. Any decent language will enable you to send e-mails programatically.