data = { {"Gauss", "Jane", "Q", 2}, {"Archimedes", "John", "Q", 3}, {"Babbage", "Chuck", "", 5}, {"Newton", "Jenn", "R", 1}, {"Maxwell", "Juan", "V", 4}, {"Boltzmann", "Manuela", "J", 7}, {"Fibonacci", "Fred", "F", 6}, {"Gibbs", "Rachel", "G", 9}, {"Dewar", "John", "W", 8} };
messageForm = "Hello `1`,\n\nYou are number `2` in the queue."; buildEmail[messageForm_String, entry_] := ( {"To" -> ToLowerCase@entry[[2]] <> "example@wolfram.com", "Subject" -> "Position in queue", "Body" -> StringReplace[messageForm, {"`1`" -> entry[[2]], "`2`" -> ToString@entry[[4]]}] } )
SendMail[buildEmail[messageForm, #]] & /@ data;