Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail place e-mail address in the CC  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

does anyone know how to place an email address on the cc??
so when the user receive the email he can see his name on the CC and not in the TO.


thanks

ppr
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Just add a recipient to the message with the MessageRecipientType == Message.RecipientType.CC.
[ November 19, 2004: Message edited by: Paul Sturrock ]
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EXCELLENT!!!


thanks a lot

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, one more thing:

when recieveing the email i get it as:

peterprimrose@verizon.net,

how can I convert this format to my name as:

Peter Primrose


(so when the user recieve the email he'll see:
Peter Primrose
and not my actual email addresss: peterprimrose@verizon.net


Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's really down to your MUA (Outlook, Pegasus or whatever) An RFC822 internet address can be this:

So you could define the address that way, however you've no control on how it will be displayed. Its a happy coincidence that Outlook churns out long addresses as "Firstname Lastname", and hides the rest of it. But there is nothing to say it has to.

If its the from address you are worried about, remember that there are two from addresses (so to speak) defined in SMTP - the "from" address and the "reply to" address. You can define a from address which is garbage in the context of routing email, but meaningful to the recipient, and add a reply to address which probably does not get displayed (again its up to the MUA though) but means the user can reply.
[ November 19, 2004: Message edited by: Paul Sturrock ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!