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...

