This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes sending email in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "sending email in servlet" Watch "sending email in servlet" New topic

sending email in servlet

Jinal P Shah

Joined: Apr 29, 2011
Posts: 12
I am creating a GWT application and trying to send email using a servlet but it gives me an exception here is my code

Can any please help me with this.

Regards and Thanks in Advance.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
but it gives me an exception

I will never in a million years understand why people do this

WHY don't you show the exception

The Java exception mechanism is designed to communicate lots of information about the cause and location of the problem.

Jinal P Shah

Joined: Apr 29, 2011
Posts: 12
Here is the webpage please look for yourself the exception coming webpage.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

Here's a helpful hint: if you aren't going to put in at least a little effort to try and get an answer, why should people like William bother to use their volunteer time to help you?

[Asking smart questions] [About Bear] [Books by Bear]
Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

You're trying to send from a GMail user while not using GMail*. The exception says the sender is unauthorized. Apparently either GMail or your local server doesn't like the From address. Try using GMail's own SMTP server; there are many threads about it, and I believe even an FAQ entry.

* well, that's what I'm actually assuming. The lack of any explicit SMTP host makes me think the local host is used.

How To Ask Questions How To Answer Questions
Jinal P Shah

Joined: Apr 29, 2011
Posts: 12
Thanks for the answer Rob. I'll definitely look into it.

Bear Bibeault I totally agree with you and surely what you are telling me is correct but since I was not getting it so I wanted to ask you guys just to show me the direction. Surely you guy are doing a great job. Thanks anyways.

I agree. Here's the link:
subject: sending email in servlet
jQuery in Action, 3rd edition