Hi all, I am new to Gradle & Groovy. I can send an email from an ant script, but cannot figure out how to do the same thing in Gradle. Below is my Gradle script:
task sendMail << {
ant.mail (mailhost:'smtp.host.com', mailport:'25', subject:'test email') {
from (address:'aaa@host.com')
to (address:'bbb@host.com')
message ('message content here')
}
}
When run “gradle sendMail”, the build is failed and the error is:
When I run this script, it is showing the following error.
What went wrong: A problem occurred evaluating root project ‘gradle-download-task-master’. > Could not resolve all dependencies for configuration ‘:antClasspath’.
Could not find ant:ant-javamail:1.6.5.
Required by:
:gradle-download-task-master:4.0
Could not find javax.activation:activation:1.1.1.
Required by:
:gradle-download-task-master:4.0
Could not find javax.mail:mail:1.4.7.
Required by:
:gradle-download-task-master:4.0
Can any body tell me where I am going wrong? Any pointers would be helpful.