This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Mail API Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Mail API Problem" Watch "Mail API Problem" New topic
Author

Mail API Problem

Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
i have used the following code to send mails through the application where name= "Hrishikesh Maluskar".



but the mails gets sent in the following format


I want it to be sent as follows


SCJP 1.5
www.licexpadvice.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41178
    
  45
In line 34 you're concatenating the value of "subject" instead of the password.


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Are you sure you're not mixing up the subject and message (body) too? The subject usually can't contain line breaks.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
ok thanks , i am a very stupid person
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

I wouldn't say that. I've made similar mistakes in the past as well, and I'm sure many others have as well. In those cases the best step is let someone else look at the problem; a fresh set of eyes can do wonders. And that's just what you did, so I'd call you smart sooner than stupid.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Mail API Problem
 
Similar Threads
Suggestions - JavaMail
calling something like mailto from Java program
sending mails through java
java mail throws
Sending Email from Servlet.