Created
May 19, 2010 19:22
-
-
Save virtix/406726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.mail.* | |
mail_server = 'mail.server' | |
def send_mail = { cnt,sender,recipient,headers -> | |
println 'sending mail ' + cnt | |
email = new SimpleEmail(); | |
email.setHostName mail_server | |
email.addTo recipient, 'to_' + cnt | |
email.setFrom sender, 'from_' + cnt | |
email.setSubject 'Test message ' + cnt | |
email.setHeaders(headers); | |
email.setMsg 'testing ... ' + cnt | |
email.send() | |
println 'happy mail sent' | |
} | |
for (i in 1..10) { | |
headers = ['x-some-header':'value'] | |
send_mail i,'[email protected]','[email protected]', headers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment