I want to send email programmatically. For that, i wrote the below code:
if(field == m_btnSend)
{
Store store = Session.getDefaultInstance().getStore();
Folder[] folder = store.list(Folder.SENT);
Folder sent = folder[0];
Message msg = new Message(sent);
Address receipent[] = new Address[1];
try
{
receipent[0] = new Address("arindam.hit@gmail.com", "Arindam");
msg.addRecipients(Message.RecipientType.TO, receipent);
msg.setSubject("Test Mail");
msg.setContent("This mail is to remind you that programmatically we can send the mail");
msg.setPriority(Priority.HIGH);
Transport.send(msg);
}
catch (Exception e)
{
e.printStackTrace();
}
}
I am runnig it in MDS simulator. Now i want to see this mail in by mail inbox if i open my mail through simulator browser. How it is possible??
Thanks.
This is the code to send the attachments with mail and it works very well on device: