0

How to send a mail from non existing mail? Example: no-reply@mydomain.com using Spring Mail Sender Configuration. A mail doesn't exists so that reply to email address should fail.

Solution with java mail also preferred.

I tried with this too. It is not working with spring framework. (Unknown Sender) when sending email with pdf attachment created in iText from java application

no-reply@mydomain.com

Community
  • 1
  • 1
Arunkumar S
  • 112
  • 2
  • 14

1 Answers1

2

If you're not using SMTP authentication then it doesn't matter whether the email exists or not.

You can send email from addresses that doesn't exist without using SMTP authentication but that's usually a bad practice because such email's are usually evaluated as spam by most of the spam filters.

See this answer for more details.

Hence it's best practice to send email using SMTP authentication. But when sending email using that way you should have all credentials like email, password, outgoing server, port etc... and so you'll need a email that does exists.

Raman Sahasi
  • 30,180
  • 9
  • 58
  • 71
  • I tried without using SMPT authentication. It got failed. I tried this way, "By configuring with authenticated login like myname@mydomain.com in configuration but to set the sender no-reply@mydomain.com with mimemessage.setfrom as mentioned here.http://stackoverflow.com/questions/1567467/setting-the-from-name-in-a-javax-mail-mimemessage I received mail from myname@mydomain.com but not from no-reply@mydomain.com – Arunkumar S Jul 19 '16 at 12:54
  • You can post what problem are you getting as a saperate question or you can append it in this question itself. Bottom line is you should always do it using SMTP authentication. Otherwise what's the use of sending mails when all of them are delivered to `junk` or `spam` folders? – Raman Sahasi Jul 19 '16 at 12:57