Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is the "From" Email Address Necessary?

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a web site. Users of this web site can send e-mails. And the JavaMail is deployed to facilitate this feature.

A 'form' is provided for users to send e-mails. And the form has these text fields: From, To, Subject, Message.

I am going to use getRemoteUser() to obtain the userID of the person who is sending e-mails and fill out the 'From' text field with this userID.

Does the 'From' has to be an e-mail address in order to use the JavaMail standard send message code? In my case, users do not have to fill out their own e-mail addresses. Their userID gets entered in the 'From' text field automatically.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does the 'From' has to be an e-mail address in order to use the JavaMail standard send message code?

No - it can be anything you like. But your SMTP server might have restrictions on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic