H
Hemant.Pahilwani
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);
}
}
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);
}
}