Email received sent via webmail but not Javamail

I'm trying to send emails via Javamail to a corporate account. My Java test app works fine when I send message to gmail and my personal email. I can also successfully send to the corporate account via my email hosting webmail client.

I've read through posts here and have tried setting -Djava.net.preferIPv4Stack=true in the VM for the test app but it did not work.

I have checked the junk mail at the corporate client and the message is not there. That is not to say its not being blocked elsewhere at the corporate site.

Any ideas what can be causing this problem?

I'm using org.apache.commons.mail.HmtlEmail and this is the test code:

          // Create the email message
          HtmlEmail email = new HtmlEmail();

          email.setHostName(smtpHost);

          email.setAuthenticator(new DefaultAuthenticator(smtpUser, smtpPwd));

          email.setSSLOnConnect(true);

          email.addTo(to);

          email.setFrom(from);

          email.setSubject(subject);

          // set the html message
          email.setHtmlMsg(text);

          // set the alternative message
          email.setTextMsg("Your email client does not support HTML messages");

          // send the email
          email.send();

Answers


So @Bill's question regarding Javamail debug output got me thinking about the content of the email message. The debug log shows all is fine but what I found was I included Bootstrap and Fontawsome JS / CSS links in the email header and that caused the message to be rejected by the corporate system for security reasons presumably. Thanks for the help


Need Your Help

WebGL CORS: An attempt was made to break through the security policy of the user agent.

javascript html html5 cors

How do I get Cross-Origin Resource Sharing to work properly with WebGL textures? I think I took all the steps I needed to.

Date is null in Web Service response

soap wsdl jax-ws

I'm trying to implement a client which asks a JAX Web Service for certain data. I used the wsimport command (Java 7u45 is installed) to generate the client classes from the wsdl. I have no problem