What could be causing SMTPSenderFailedException: 501 5.1.7 Invalid address using java mail?












0















Unfortunately, this is at a customer site, so we can't debug. Apparently it's been verified that both the to and from emails are valid. They are apparently using 'open authentication' because it is behind their firewall, so in that case our Properties and Session looks like this:



Properties props = new Properties();
props.put("mail.smtp.host", configuredHost);
props.put("mail.smtp.port", configuredPort);
props.put("mail.smtp.auth.login.disable", "true");
Session session = Session.getDefaultInstance(props, null);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(fromEmail));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
message.setSubject(subject);
message.setContent(messageBody, "text/html");
message.setSentDate(new Date());


This code is in use at other sites, and working. So what issue in their environment could be causing this?










share|improve this question



























    0















    Unfortunately, this is at a customer site, so we can't debug. Apparently it's been verified that both the to and from emails are valid. They are apparently using 'open authentication' because it is behind their firewall, so in that case our Properties and Session looks like this:



    Properties props = new Properties();
    props.put("mail.smtp.host", configuredHost);
    props.put("mail.smtp.port", configuredPort);
    props.put("mail.smtp.auth.login.disable", "true");
    Session session = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(fromEmail));
    message.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
    message.setSubject(subject);
    message.setContent(messageBody, "text/html");
    message.setSentDate(new Date());


    This code is in use at other sites, and working. So what issue in their environment could be causing this?










    share|improve this question

























      0












      0








      0








      Unfortunately, this is at a customer site, so we can't debug. Apparently it's been verified that both the to and from emails are valid. They are apparently using 'open authentication' because it is behind their firewall, so in that case our Properties and Session looks like this:



      Properties props = new Properties();
      props.put("mail.smtp.host", configuredHost);
      props.put("mail.smtp.port", configuredPort);
      props.put("mail.smtp.auth.login.disable", "true");
      Session session = Session.getDefaultInstance(props, null);
      Message message = new MimeMessage(session);
      message.setFrom(new InternetAddress(fromEmail));
      message.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
      message.setSubject(subject);
      message.setContent(messageBody, "text/html");
      message.setSentDate(new Date());


      This code is in use at other sites, and working. So what issue in their environment could be causing this?










      share|improve this question














      Unfortunately, this is at a customer site, so we can't debug. Apparently it's been verified that both the to and from emails are valid. They are apparently using 'open authentication' because it is behind their firewall, so in that case our Properties and Session looks like this:



      Properties props = new Properties();
      props.put("mail.smtp.host", configuredHost);
      props.put("mail.smtp.port", configuredPort);
      props.put("mail.smtp.auth.login.disable", "true");
      Session session = Session.getDefaultInstance(props, null);
      Message message = new MimeMessage(session);
      message.setFrom(new InternetAddress(fromEmail));
      message.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
      message.setSubject(subject);
      message.setContent(messageBody, "text/html");
      message.setSentDate(new Date());


      This code is in use at other sites, and working. So what issue in their environment could be causing this?







      java smtp javamail






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 '14 at 20:30









      user26270user26270

      2,783124070




      2,783124070
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The server disagrees with you about whether the address is valid.



          You didn't include the code where you send the message so I can't tell if you're authenticating to the server. If you're not, that may be why the server is rejecting your address.






          share|improve this answer
























          • There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

            – user26270
            Mar 9 '14 at 18:42











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22260110%2fwhat-could-be-causing-smtpsenderfailedexception-501-5-1-7-invalid-address-using%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The server disagrees with you about whether the address is valid.



          You didn't include the code where you send the message so I can't tell if you're authenticating to the server. If you're not, that may be why the server is rejecting your address.






          share|improve this answer
























          • There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

            – user26270
            Mar 9 '14 at 18:42
















          0














          The server disagrees with you about whether the address is valid.



          You didn't include the code where you send the message so I can't tell if you're authenticating to the server. If you're not, that may be why the server is rejecting your address.






          share|improve this answer
























          • There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

            – user26270
            Mar 9 '14 at 18:42














          0












          0








          0







          The server disagrees with you about whether the address is valid.



          You didn't include the code where you send the message so I can't tell if you're authenticating to the server. If you're not, that may be why the server is rejecting your address.






          share|improve this answer













          The server disagrees with you about whether the address is valid.



          You didn't include the code where you send the message so I can't tell if you're authenticating to the server. If you're not, that may be why the server is rejecting your address.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 '14 at 23:05









          Bill ShannonBill Shannon

          23.7k43133




          23.7k43133













          • There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

            – user26270
            Mar 9 '14 at 18:42



















          • There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

            – user26270
            Mar 9 '14 at 18:42

















          There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

          – user26270
          Mar 9 '14 at 18:42





          There is no authentication, as I said in the original post. It apparently resolved itself. I think it was user error with the addresses.

          – user26270
          Mar 9 '14 at 18:42




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22260110%2fwhat-could-be-causing-smtpsenderfailedexception-501-5-1-7-invalid-address-using%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()