Hi Gurus,
I have tired to use Javamail to send email. But I got the following message
javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Illegal Arguments (java.lang.IllegalArgumentException: Bad Request: ))
I have tried to send email from the admin (account I upload the app) or the user I login the app as. (from UserService - getCurrentUser().getEmail()
) Both failed
Wonder if there is any special setting I have to setup
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
UserService userService = UserServiceFactory.getUserService();
String email = userService.getCurrentUser().getEmail();
//Or
//String email = "[email protected]";
msg.setFrom(new InternetAddress(email));
msg.addRecipient(Message.RecipientType.TO,
new InternetAddress("[email protected]"));
msg.setSubject("Test Email");
msg.setText("Nobody");
Transport.send(msg);
Please Advise Thanks Roy