JavaMail Best Practices

Here are some best practices you can follow when using JavaMail in your WebLogic Server applications:

Using JavaMail to Confirm Email Addresses

When a user registers for your site, your application probably asks for the user's correct email address. Use JavaMail to send an email from your system to validate the email address. To have users confirm that they have correctly received the email, have them revisit your site using a URL that you provide in the body of the mail.

The URL that the user clicks in the email you send should be unique for that user. You can encapsulate a unique value into that URL by including it as an HTTP POST: http://myhost.com/validate?token=someuniquevalue

Once the user revisits your site with ...

Get J2EE™ Applications and BEA™ WebLogic Server™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.