java mail replyTo problem

Discussion in 'Java' started by Hemant.Pahilwani@gmail.com, May 22, 2008.

  1. Guest

    I am currently sending email from my application which sets ReplyTo
    field. If i send this email to my outlook email and reply to this
    email from outlook, then i behaves properly i.e. the To address in the
    reply is the email address that i had set in ReplyTo field while
    sending email. But if i send the email to gmail or yahoo and reply
    to it, the ReplyTo address is same as as To email address, it is not
    taking the value that i had set in ReplyTo field.

    Ne ideas of what could be wrong? Given below is the function that
    send out the email

    public void send(String from, String to, String cc, String subject,
    String text, String content_type,
    String replyTo) {

    javax.mail.Session session =
    javax.mail.Session.getDefaultInstance(m_props, null);
    MimeMessage msg = new MimeMessage(session);

    try {
    msg.setFrom(new InternetAddress(from));

    if (replyTo != null) {
    InternetAddress[] replyToAddress = new
    InternetAddress[1];
    replyToAddress[0] = new InternetAddress(replyTo);
    msg.setReplyTo(replyToAddress);
    }

    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    if (cc != null)
    msg.setRecipients(Message.RecipientType.CC,
    InternetAddress.parse(cc, false));

    String enc = "UTF-8";

    msg.setSubject(subject, enc);
    ..
    ..
    ..
    ..
    ..
    ..
    .. String henc = ComergentI18N.getHTMLEncoding();

    msg.setHeader("Content-Type"/*I18NOK:27751106*/,
    content_type + ";charset="/*I18NOK:27771106*/ + henc/*I18NOK:
    27761702*/);

    msg.setHeader("Content-Encoding"/*I18NOK:a1d1106*/, henc);
    // send the thing off
    Transport.send(msg);
    } catch (javax.mail.MessagingException e) {
    String args[] = {e.getMessage()};
    throw new ICCException(UtilErrors.ICC_E_SEND_SMTP_FAILED,
    args);
    }
    }
     
    , May 22, 2008
    #1
    1. Advertising

  2. Roedy Green Guest

    On Thu, 22 May 2008 10:56:34 -0700 (PDT),
    wrote, quoted or indirectly quoted someone who said :

    >Ne ideas of what could be wrong? Given below is the function that
    >send out the email


    Gmail likely has a bug. They might consider it a feature. Rude
    people often use a reply to to direct responses to some disreputable
    place.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, May 22, 2008
    #2
    1. Advertising

  3. On 22/05/08 11:26 PM, wrote:
    > I am currently sending email from my application which sets ReplyTo
    > field. If i send this email to my outlook email and reply to this
    > email from outlook, then i behaves properly i.e. the To address in the
    > reply is the email address that i had set in ReplyTo field while
    > sending email. But if i send the email to gmail or yahoo and reply
    > to it, the ReplyTo address is same as as To email address, it is not
    > taking the value that i had set in ReplyTo field.
    >
    > Ne ideas of what could be wrong? Given below is the function that
    > send out the email


    It's a bug/feature in GMail. In certain cases, GMail will ignore the
    Reply-to header in the email and send replies to the sender of the
    email. One case we noticed was if the From and To addresses are
    identical (which might happen during testing).
     
    Shantanu Joshi, May 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TXJGZXo=?=

    Mail message size problem (System.Web.Mail)

    =?Utf-8?B?TXJGZXo=?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    669
    =?Utf-8?B?TXJGZXo=?=
    Mar 14, 2005
  2. Sara T.
    Replies:
    1
    Views:
    593
    Sean M
    Jun 29, 2005
  3. JBoss JMS ReplyTo

    , Nov 2, 2005, in forum: Java
    Replies:
    0
    Views:
    2,115
  4. Replies:
    0
    Views:
    1,471
  5. shank

    ReplyTo in ASP Mail

    shank, Apr 12, 2004, in forum: ASP General
    Replies:
    1
    Views:
    150
    Dominique
    Apr 13, 2004
Loading...

Share This Page