0

I need a javax setup where I will receive mails at username@domain.com and acknowledge/reply users from username.noreply@domain.com.

Can I achieve this using username.noreply@domain.com not being an actual mailbox, but just like an alias address to avoid spam.

I tried lot options but not really working.

  1. message.setFrom(new InternetAddress("username.noreply@domain.com",senderName)); giving error com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Client does not have permissions to send as this sender

  2. message.setSender(new InternetAddress("username.noreply@domain.com")); giving error com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.1 Client does not have permissions to send as this sender

  3. message.setReplyTo(new Address[]{new InternetAddress("username.noreply@domain.com")}); Using this users can still see sender as username@domain.com and automated replies are directed to the original sender.

Thanks!

Amresh
  • 315
  • 1
  • 5
  • 14
  • Do you want to send emails from username.noreply@domain.com ? And that address is a fake address so noone can reply to ? I don't understand what you want to do with username@domain.com – Gamby Aug 31 '17 at 10:14
  • You need to configure your mail server to allow you to send from that address. If you're using an email service, they're unlikely to allow you to send from an invalid address. You can always configure that to be a valid address that discards all the mail it receives. (How? It depends on the mail server.) – Bill Shannon Sep 01 '17 at 02:19
  • username@domain.com is meant only to receive emails. I do not want an additional mailbox for username.noreply. For giving permissions as sender in mail server, this needs to be an additional mailbox. – Amresh Sep 01 '17 at 11:25
  • Trying to setup email without authentication, this should work. – Amresh Sep 13 '17 at 08:09

0 Answers0