Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2007, 06:46 AM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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













Similar Threads
Thread Thread Starter Forum Replies Last Post
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
java bean file not found / cannot resolve symbol r Calverstine JSP Basics 4 July 3rd, 2006 05:38 AM
cannot resolve object, cannot find java file!!help Calverstine Apache Tomcat 3 May 22nd, 2006 03:02 PM
Java Mail Problem in WebSphere vempativv J2EE 0 April 14th, 2004 11:18 PM
cannot resolve symbol problem ioda006 JSP Basics 2 July 28th, 2003 06:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.