title: Can't Send Mail in Java
body: <p>I am trying to send mail in java but i keep getting this error "com.sun.mail.smtp.SMTPSendFailedException: 550 failed to meet SPF requirements" , i have scoured the internet looking if anyone else has got this problem in java and found nothing. Any body have an idea what this error means? My code that sends the email is below.</p>
  
  <pre><code>            //Create session and message
              Properties props = System.getProperties();
              props.put("mail.smtp.user", user);
              props.put("mail.smtp.password", password);
              props.put("mail.smtp.auth", "false");
              props.put("mail.smtp.host", mailhost);
  
              javax.mail.Authenticator auth = null;
              auth = new javax.mail.Authenticator() {
                  @Override
                  public javax.mail.PasswordAuthentication getPasswordAuthentication() {
                      return new javax.mail.PasswordAuthentication(user, password);
                  }
              };
              session = Session.getInstance(props, auth);
              Message msg = new MimeMessage(session);
  
             //Set from,recipients,content and other stuff here
             //...................
  
             //Send the message
             Transport.send(msg);
  </code></pre>