Skip to content

Instantly share code, notes, and snippets.

@mresetar
Created January 29, 2012 14:50
Show Gist options
  • Save mresetar/1699133 to your computer and use it in GitHub Desktop.
Save mresetar/1699133 to your computer and use it in GitHub Desktop.
Groovy send e-mail
@GrabConfig(systemClassLoader=true)
@Grapes(
@Grab(group='javax.mail', module='mail', version='1.4.4')
)
def ant = new AntBuilder()
ant.mail(mailhost:'localhost', mailport:25, subject:'Test message') {
from(address:'mySystem@localhost')
cc(address:'mySystem@localhost')
to(address:'tester@localhost')
message("Test mail sent on ${new Date()}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment