3

I'm coming over here from StackOverflow trying to find an answer for my question:

I'm trying to send an email, and I get this email back:

Delivery to the following recipient failed permanently:

booking@domain.de

Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the server for the recipient domain domain.de by mail.domain.de. [88.198.227.52].

The error that the other server returned was: 554 5.7.1 : Recipient address rejected: Relay access denied

I don't really understand this error, all I found out was that it seems like google doesn't want to send an email to this domain because it doesn't trust it.(?)

I'm trying to send this email from an app, here are some settings I made prior to sending it. I tried from the normal gmail.com webinterface too, but this results in the same error.

props.setProperty("mail.transport.protocol", "smtp");
    props.setProperty("mail.host", mailhost);
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.port", "465");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class",
            "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");
    props.setProperty("mail.smtp.quitwait", "false");

Does anyone have an idea what I have to add here in order to avoid this error and get my email through? Can anyone also elaborate on this error, I have not found a good explanation on the internet about it yet.

This is the original question on StackOverflow

3
  • From your original question on SO you say that emails are being received by this email address daily. Can you confirm whether you are able to send emails to this address from a non-gmail account? – MrWhite May 9 '16 at 10:13
  • It resolves in the same problem. I know only one domain (another private one) where I can send emails to this domain, which is done daily – Maverick283 May 9 '16 at 10:21
  • It has been a while for me, however, Relay access denied tells me that you are trying to relay an e-mail from one SMTP through another. This often has something to do with authentication. It may be that the SMTP server presenting the error is not seeing user authentication. Relays are often made open to other trusted SMTP servers so that e-mail can be bounced off of the SMTP server into the wild. I do this with my automation, however, I also have SMTP servers that do full logins before sending e-mail. The error tells me to look at authorization first. Cheers!! – closetnoc May 9 '16 at 13:32
1

Based on the error message it would appear as though your sending the email through a Google email server. Google requires SSL/TLS and authentication on all SMTP connections. Your code indicates that you are authenticating but that you aren't specifying the SMTP username and password.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.