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.
//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);