• Post Reply Bookmark Topic Watch Topic
  • New Topic

dynamic link for email

 
Srini Nivas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am developing a web application within which I need a link which sends a mail to the user. How to do this if 1) The content of the mail is same for all the users 2) Content contains user information too (generate content dynamically depending on the user).
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard API for handling email in Java is called JavaMail. Why would sending email with the same content to all users be any differetn than sending email with personalized content? JavaMail doesn't care what the contents of the message are, and it supports CC and BCC, if you want to use those.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A common way to do that in a web application is to use a mailto: URL. You can specify the to-address and the subject and the body. When the user clicks on the link it doesn't actually send the mail, it calls up the user's "default mail program" and opens a message. Then it's up to the user to actually send the message. (That last part is necessary to prevent you from sending mail from the user's account without the user knowing.)
 
Srini Nivas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give a sample code to send the email directly instead of opening a link!!!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give a sample code to send the email directly instead of opening a link!!!

Hello-

I don't know what to make of this. The sentence start with "can you", indicating that a question might follow, but it ends with "!!!", which looks to me like an order is being given. Maybe you can indicate which one it is - I think that responses might differ depending on the answer to that. (And remember that one of the principles of JavaRanch is "Be Nice!".)
[ January 12, 2006: Message edited by: Ulf Dittmer ]
 
Srini Nivas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOOh....U GOT ME WRONG....THAT WAS A REQUEST AND NEVER AN ORDER.....WELL FEEL SORRY FOR NOT BEING ABLE TO EXPRESS PROPERLY.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And your caps-lock got stuck, so now you are shouting at us...

Anyway, you cannot use a web page to cause the client computer to send an e-mail message, unless a person at the client computer helps the process along. This is just basic anti-spam security. So forget that idea.

The other common way to get an e-mail message sent is to ask the client to fill in a form, then when they click on the Submit button, that causes a servlet (or something) to run on your server, and it sends the e-mail via the server's e-mail account. Of course the message then comes from you and not the client, but that's just something you have to live with.
 
Srini Nivas
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for the suggestion.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!