Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MimeMessage

 
rahul jadeja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way when you send an email using mimeMessage..
how can you also set a name in the from field
i can add the email address in the from field but cant set a name to it
this is my code

<activationEmailSender>abc@yahoo.com</activationEmailSender>
<activationEmailSubject>Account activation notice</activationEmailSubject>
<activationEmailBody> Your hello code is: ${activationCode}</activationEmailBody>
i can add the email address using the activationEmailSender but i cant add name to it
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Other JSE/JEE APIs as that's where we discuss JavaMail.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not code, that looks like an XML fragment that's used to configure some email sending process.

If you were using the MimeMessage class directly, the you could use its setFrom(Address) method for this.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rahul jadeja wrote:how can you also set a name in the from field
i can add the email address in the from field but cant set a name to it

I am going to guess that you mean this:
rahul jadeja <abc@yahoo.com>

Is that what you meant?

(Don't forget to escape the < and > characters in your XML text node.)
 
rahul jadeja
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I mean that
rahul jadeja <abc@yahoo.com>
thanks for the reply
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried all the InternetAddress constructors? I'm sure one of them allows this kind of email addresses.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!