2

I am using HtmlEmail Class of ApacheCommons for sending HTML formatted email with embedded images

Apache Commons Email API (v1.4) is used in my Scala project

I am not Seeing the Alias (MY REPORTS) as sender name in my Received Email

Following is my Function

@throws(classOf[EmailException])
  @throws(classOf[Exception])
  def createHTMLEmailMessage(htmlContent: String): EmailMessage = {

    val email = new HtmlEmail

    // alternative message if the client does not support html

    email.setHtmlMsg(htmlContent)

    email.addTo("TO_address@gmail.com")

    email.setFrom("MY_address@GMAIL.com", "MY REPORTS")

    email.setHostName("MY_HOSTNAME")

    email.setSmtpPort(587)

    email.setAuthentication("USERNAME","PASSWORD")

    email.setStartTLSEnabled(true)

    email.setSSLOnConnect(false)

    email.setSubject("Subject")

    val emailMsg = EmailMessage(email)

    emailMsg

  }
axnet
  • 5,146
  • 3
  • 25
  • 45
  • UPDATE When we do View Source on Email Received in Outlook, in Source From: MY REPORTS To: But on Display FROM name (Alias is not reflecting) – axnet Apr 18 '16 at 07:29

0 Answers0