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.
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 sendermessage.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 sendermessage.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!