You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Unable to send email via Java Mail in JCS-SX

Received Response
14
Views
1
Comments
edited Aug 23, 2018 1:39AM in Java 1 comment

Summary

Unable to send emails via JCS-SX

Content

I followed all the instructions here:

 

https://docs.oracle.com/en/cloud/paas/javase-cloud/csjsu/using-command-line-interface-manage-oracle-java-cloud-service-saas-extension.html#GUID-CD2CE3C6-3567-42C3-B53F-D76E878FCB8C

 

And then deployed a webservice to test the Oracle Email Gateway service in my Java Code. 

Here is my code :

 

    public boolean sendEmail() {


        Properties props = new Properties();

        props.put("mail.smtp.auth", "true");

// Not sure if I need to use some more properties ?

        Session session =
            Session.getInstance(props, new javax.mail.Authenticator() {
                public PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication("emailUser", "*****");
                }
            });

        // Session session = Session.getInstance(props);

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!