Who can tell me about the addresses?

I'm trying to send an email to via my contact us page, to my info mail account...

but my problems is about addresses...

boolean debug =false;// change to get more information

String msgText ="A body.\nthe second line.";

String msgText2 ="Another body.\nmore lines";

boolean sendmultipart =false;

// set the host

Properties props =new Properties();

props.put("mail.smtp.host","?");

// create some properties and get the default Session

Session session = Session.getDefaultInstance(props,null);

session.setDebug(debug);

try{

// create a message

Message msg =new MimeMessage(session);

// set the from

InternetAddress from =new InternetAddress("?");

msg.setFrom(from);

InternetAddress[] address ={new InternetAddress("?")};

msg.setRecipients(Message.RecipientType.TO, address);

msg.setSubject("JavaMail APIs Test");

if (!sendmultipart){

// send a plain text message

msg.setContent(msgText,"text/plain");

}else{

// send a multipart message

// create and fill the first message part

MimeBodyPart mbp1 =new MimeBodyPart();

mbp1.setContent(msgText,"text/plain");

// create and fill the second message part

MimeBodyPart mbp2 =new MimeBodyPart();

mbp2.setContent(msgText2,"text/plain");

// create the Multipart and its parts to it

Multipart mp =new MimeMultipart();

mp.addBodyPart(mbp1);

mp.addBodyPart(mbp2);

// add the Multipart to the message

msg.setContent(mp);

}

Transport.send(msg);

}catch (MessagingException mex){

mex.printStackTrace();

}

if i want to send an email, to: info@example.com

via, mail.example.com, mail server....

and from example@yahoo.com...

can any one say me how to put addresses instead of (?) marks?

i mean, if i used as i mensioned (info@example.com.. and others) it gives me, an exception of Invalid address...

[3420 byte] By [amanjpro@yahoo.coma] at [2007-11-27 9:34:11]
# 1
I need more details about the exception and where it occurs in your program.Also, the protocol trace with your mail server might help. (See the JavaMailFAQ.)BTW, you should probably use the setText method instead of setContent.
bshannona at 2007-7-12 22:57:47 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
thanks, i think that i solve my problem...thank you again
amanjpro@yahoo.coma at 2007-7-12 22:57:47 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...