Posted: Wed Sep 16, 2015 10:18 am Post subject: How to send emails using Ant Script.
Newbie
Joined: 10 Sep 2015 Posts: 4
Hi,
Can anyone help me sending emails using Ant Script.
I am trying to send emails using ant script ..
When i try to run my ant file using the following command:
D:\MailSend> ant
I am getting the problem like below...
email:
[mail] Sending email: Test build
......
it is not displaying promt at all ...
which means it is hanging some where ..
Here is my code ..
<?xml version="1.0"?>
<project name="Demo" default="mail" basedir=".">
<target name="mail">
<mail mailhost="smtp.gmail.com" mailport="465" password="********" subject="Test build" user="useremailid@gmail.com">
<from address="useremailid@gmail.com"></from>
<replyto address="xyz@gmail.com"></replyto>
<to address="xyz@gmail.com"></to>
<message>MSS</message>
</mail>
</project>
Other thing is that when we are giving the ssl="true" inside the mail tag
then I am getting another exception like below..
D:\MailSend>ant
Buildfile: D:\MailSend\build.xml
mail:
[mail] Sending email: Test build
[mail] Failed to send email: Could not connect to SMTP host: smtp.gmail.com, port: 465
BUILD FAILED
D:\MailSend\build.xml:14: Problem while sending mime mail:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum