javax.mail.Message.getReplyTo()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中javax.mail.Message.getReplyTo()方法的一些代码示例,展示了Message.getReplyTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getReplyTo()方法的具体详情如下:
包路径:javax.mail.Message
类名称:Message
方法名:getReplyTo

Message.getReplyTo介绍

[英]Get the addresses to which replies should be directed. This will usually be the sender of the message, but some messages may direct replies to a different address.

The default implementation simply calls the getFrom method.

This method returns null if the corresponding header is not present. Returns an empty array if the header is present, but contains no addresses.
[中]获取回复应该指向的地址。这通常是邮件的发件人,但有些邮件可能会直接回复到不同的地址。
默认实现只调用getFrom方法。
如果相应的头不存在,此方法将返回null。如果标头存在但不包含地址,则返回空数组。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

break;
case MailInputField.COLUMN_REPLY_TO:
 r[index] = StringUtils.join( message.getReplyTo(), ";" );
 break;
case MailInputField.COLUMN_RECIPIENTS:

代码示例来源:origin: pentaho/pentaho-kettle

when( message.getReplyTo() ).thenReturn( adrRep );
when( message.getAllRecipients() ).thenReturn( adrRecip );
when( message.getDescription() ).thenReturn( DESC );

代码示例来源:origin: oblac/jodd

replyTo(msg.getReplyTo());

代码示例来源:origin: spring-projects/spring-integration

/**
 * Map the message headers to a Map using {@link MailHeaders} keys; specifically
 * maps the address headers and the subject.
 * @param source the message.
 * @return the map.
 */
public static Map<String, Object> extractStandardHeaders(Message source) {
  Map<String, Object> headers = new HashMap<String, Object>();
  try {
    headers.put(MailHeaders.FROM, convertToString(source.getFrom()));
    headers.put(MailHeaders.BCC, convertToStringArray(source.getRecipients(RecipientType.BCC)));
    headers.put(MailHeaders.CC, convertToStringArray(source.getRecipients(RecipientType.CC)));
    headers.put(MailHeaders.TO, convertToStringArray(source.getRecipients(RecipientType.TO)));
    headers.put(MailHeaders.REPLY_TO, convertToString(source.getReplyTo()));
    headers.put(MailHeaders.SUBJECT, source.getSubject());
    return headers;
  }
  catch (Exception e) {
    throw new MessagingException("conversion of MailMessage headers failed", e);
  }
}

代码示例来源:origin: google/mail-importer

@Override
public Address[] getReplyTo() throws RuntimeMessagingException {
 try {
  return delegate.getReplyTo();
 } catch (MessagingException e) {
  throw new RuntimeMessagingException(e);
 }
}

代码示例来源:origin: org.ow2.petals/petals-bc-mail

addresses = message.getReplyTo();
if (addresses != null) {
  for (final Address reply : addresses) {

代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin

private String getSender(Message message) throws MessagingException
  {
    final Address[] froms = message.getFrom();
    if (froms.length>0)
    {
      if (froms[0] instanceof InternetAddress)
      {
        InternetAddress internetAddress = (InternetAddress) froms[0];
        return internetAddress.getAddress();
      }
    }

    final Address[] replyTos = message.getReplyTo();
    if (replyTos.length>0)
    {
      if (replyTos[0] instanceof InternetAddress)
      {
        InternetAddress internetAddress = (InternetAddress) replyTos[0];
        return internetAddress.getAddress();
      }
    }
      
    return null;
  }
}

代码示例来源:origin: org.springframework.integration/spring-integration-mail

/**
 * Map the message headers to a Map using {@link MailHeaders} keys; specifically
 * maps the address headers and the subject.
 * @param source the message.
 * @return the map.
 */
public static Map<String, Object> extractStandardHeaders(Message source) {
  Map<String, Object> headers = new HashMap<String, Object>();
  try {
    headers.put(MailHeaders.FROM, convertToString(source.getFrom()));
    headers.put(MailHeaders.BCC, convertToStringArray(source.getRecipients(RecipientType.BCC)));
    headers.put(MailHeaders.CC, convertToStringArray(source.getRecipients(RecipientType.CC)));
    headers.put(MailHeaders.TO, convertToStringArray(source.getRecipients(RecipientType.TO)));
    headers.put(MailHeaders.REPLY_TO, convertToString(source.getReplyTo()));
    headers.put(MailHeaders.SUBJECT, source.getSubject());
    return headers;
  }
  catch (Exception e) {
    throw new MessagingException("conversion of MailMessage headers failed", e);
  }
}

代码示例来源:origin: medcl/elasticsearch-river-email

.field("reply_to_mail", convertAddress(message.getReplyTo()))
.field("from", getFrom(msg))
.field("to", getReceiveAddress(msg, null))

代码示例来源:origin: org.apache.james.hupa/hupa-server

if (m.getReplyTo() != null && m.getReplyTo().length >0 ) {
  replyto = MessageUtils.decodeText(m.getReplyTo()[0].toString());

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

strFrom = rgFrom[0].toString();
String strReplyTo = DBConstants.BLANK;
Address[] rgReplyTo = message.getReplyTo();
if ((rgReplyTo != null) && (rgReplyTo.length > 0))
  strReplyTo = rgReplyTo[0].toString();

代码示例来源:origin: org.apache.axis2.transport/axis2-transport-mail

if (message.getReplyTo() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getReplyTo());
} else if (message.getFrom() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getFrom());

代码示例来源:origin: org.apache.axis2/axis2-transport-mail

if (message.getReplyTo() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getReplyTo());
} else if (message.getFrom() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getFrom());

代码示例来源:origin: apache/axis2-java

if (message.getReplyTo() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getReplyTo());
} else if (message.getFrom() != null) {
  outInfo.setTargetAddresses((InternetAddress[]) message.getFrom());

代码示例来源:origin: ujmp/universal-java-matrix-package

Address[] replyTo = m.getReplyTo();
ListMatrix<String> replyToMatrix = new DefaultListMatrix<String>();
for (Address a : replyTo) {

代码示例来源:origin: juandesi/email4j

this.bccAddresses = parseAddressArray(message.getRecipients(BCC));
this.fromAddresses = parseAddressArray(message.getFrom());
this.replyToAddresses = parseAddressArray(message.getReplyTo());
this.headers = parseHeaders(message.getAllHeaders());
this.flags = parseFlags(message.getFlags());

代码示例来源:origin: org.jodd/jodd-mail

replyTo(msg.getReplyTo());

相关文章