What is wrong within this code??it's not functiong properly.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hitesh_Patel
Posted On:   Saturday, April 28, 2001 01:18 AM

Hi,there , i have to send a mail only.i worked with below but still not working. runtime error as No ClassDefinationFoundError SharedByteArrayInputstream comes, if u mention to change in my code plz mail me. code: try { Properties props=new Properties(); props.put("mail.satyam.net.in","mail.yahoo.com"); Session mailconnection=Session.getInstance(props,null); final Message msg=new MimeMessage(mailconnection); Address to=new InternetAddress("tohitesh4u@yahoo.com"); Address from=new InternetAddress("hiteshmail@rediffmail.com"); msg.setContent(password,"text/plain"); msg.setFrom(from); msg.setRe   More>>

Hi,there ,
i have to send a mail only.i worked with below but still not working.

runtime error as No ClassDefinationFoundError SharedByteArrayInputstream comes, if u mention to change in my code plz mail me.

code:

try
{
Properties props=new Properties();
props.put("mail.satyam.net.in","mail.yahoo.com");
Session mailconnection=Session.getInstance(props,null);
final Message msg=new MimeMessage(mailconnection);
Address to=new InternetAddress("tohitesh4u@yahoo.com");
Address from=new InternetAddress("hiteshmail@rediffmail.com");
msg.setContent(password,"text/plain");
msg.setFrom(from);
msg.setRecipient(Message.RecipientType.TO,to);
msg.setSubject("Your Password is..");
Runnable r=new Runnable()
{
public void run()
{
try
{
Transport.send(msg);
} catch(Exception e)
{
e.printStackTrace();
}
}
};

Thread t=new Thread(r);
t.start();
}
catch(Exception e)
{
e.printStackTrace();
}
}


Also tell me that in below am i right or not? :

Properties props=new Properties();
props.put("mail.satyam.net.in" , "mail.yahoo.com");
=================== ===============
this is my ISP where i want to send a mail.

if possible send me solution at my personal e-mail hiteshmail@rediffmail.com.

thanks in advance.


Hitesh patel,
Ahmedabad.

   <<Less

Re: What is wrong within this code??it's not functiong properly.

Posted By:   bhavesh_desai  
Posted On:   Saturday, April 28, 2001 03:40 AM

change your statement
props.put("mail.smtp.host",hostname)

in place of hostname specify your ISP smtp address i.e. mail.satyam.net.in
bye
have a nice day
About | Sitemap | Contact