i have the problem on java mail somebody resolve
i have been coding for sending email using java mail API my mail has been sent to all the reciepients but in the to field in the recipients side ids are not displayed correctly.help me to solve this problem below i have specified the code.
boolean debug=true;
//here getting mailserver and other configurations
Properties props = new Properties();
props.put(host,mailserver);
//creating a session here
Session s = Session.getInstance(props,null);
s.setDebug(debug);
//creating mime message for TO and BCC type email contents by creating seperate objects for TO and BCC EMAILS.
MimeMessage message = new MimeMessage(s);
MimeMessage bccMessage=new MimeMessage(s);
//Creating Mnltipart for adding message and attachment part.
Multipart multipart = new MimeMultipart();
Transport transport = s.getTransport("smtp");
//getting the From Address
InternetAddress fromAddress = new InternetAddress(fromEmail);
message.setFrom(fromAddress);
bccMessage.setFrom(from);
//Adding the To Address to the Mime Object
message.addRecipient(Message.RecipientType.TO,new InternetAddress(toAddress));
//Adding the BCC ADDRESS to the another MIME object
bccMessage.addRecipient(Message.RecipientType.BCC, new InternetAddress(toAddress));
bccMessage.addRecipient(Message.RecipientType.BCC, new InternetAddress(toAddress));
bccMessage.addRecipient(Message.RecipientType.BCC, new InternetAddress(toAddress));
bccMessage.addRecipient(Message.RecipientType.TO,n ew InternetAddress(toAddress));
here above adding all the bcc addresses and sending the email.
the recipient doesnt recieve the to field address
i am waiting for the reply
|