views:

24

answers:

1

Hi

I can send mails with gmail with javamail

But i cannot set the reply to anyhow...

the code i m using is...

   //the actual mail id [email protected]
   ccAddress = new InternetAddress( "[email protected]");

        msg.setFrom(ccAddress);

        Address[] addresses = new Address[1];
        //actually i want to addressee to reply-to
        addresses[0] = new InternetAddress( "[email protected]" );
        msg.setReplyTo(addresses);

        msg.setSubject(subject);
        msg.setText(text);
        msg.setHeader("MIME-Version" , "1.0" );
        msg.setHeader("Content-Type" , "text/html" );
        msg.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");

Actual gmail id is [email protected] but i read something here

was a problem with re-deploying a ejb... not a prob any more...

please delete this question...

Thanks

A: 

Before you call transport.sendMessage(), try calling msg.saveChanges()
The send() function calls this before calling sendMessage(), but if you are using sendMessage() yourself, you will have to call this to make sure any headers are saved.

RD
+1 its already there...
Pradyut Bhattacharya
You're already calling saveChanges() ? Interesting. Is the X-Mailer header getting saved?
RD
ya X-mailer is saved and shown on the headers when i check the sent mail in gmail...
Pradyut Bhattacharya
is your 'from' address the same address you are logging into gmail with?
RD
so sorry for troubling you out here... was a problem with re-deploying a ejb...a big thanks for your time...
Pradyut Bhattacharya
heh. I was wondering why I couldn't reproduce.
RD