Sending message through java mail -


Hello I'm able to send mail from my web application. But the problem here is only able to send a message to the message.

I want to send a message:

Your username is: xxxx Your password is: xxx < Pre> message message = new mime message (session); Message.setFrom (new Internet address ("xxx@gmail.com")); Message.setRecipients (Message.RecipientType.TO, Internet Address.Prase (Class.email)); Message.setSubject ("Confirm registration with SK Business Group"); Message.setContent ("& lt; h1 & gt; Congratulations on successfully registering us & lt; / h1 & gt; & lt; h2 & gt; Your username is: " + Class uname, "text / html"); Message.setContent ("& lt; h2> your password is: " + Class.pass, "text / html"); Transport.send (message);

But when the mail reaches the recipient, only the user name is displayed ...

I want to display the username and password. Someone please help me to solve this..Thanks in advance

Note: .. Uname and have a class that is found by your classname are static variables

After "text" "itemprop =" text ">

You are setting the content twice, for the code setContent : <> message.setContent ("& lt; h1> successfully Congratulations on registering us & lt; h1 & gt; From "pre +" to & lt; h2 & gt; your username is:; / h2 & gt; & lt "+ ApproveDAO.uname +" & lt; h2 & Gt; your password is: & lt; / h2 & gt; "+ Approved DO. Pass," text / html ");

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -