Advertisement
Guest User

gmail_sendmail.groovy

a guest
Aug 17th, 2010
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.40 KB | None | 0 0
  1. def sendMail(user, pw, from, recipients, subject, body) {
  2.     new AntBuilder().mail(
  3.         mailhost: 'smtp.gmail.com',
  4.         mailport: '465',
  5.         ssl: 'on',
  6.         user: user,
  7.         password: pw,
  8.         from: from,
  9.         toList: recipients,
  10.         subject: subject,
  11.         message: body
  12.     )
  13. }
  14.  
  15. sendMail('GMAIL_USERNAME', 'GMAIL_PASSWORD', 'from@domain.com', 'sendto@domain.com', 'Subject可以用中文', 'Content可以用中文, too')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement