<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to send mail and attachment file using jsp</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111600487" />
  <subtitle>How to send mail and attachment file using jsp</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111600487</id>
  <updated>2026-07-12T15:27:33Z</updated>
  <dc:date>2026-07-12T15:27:33Z</dc:date>
  <entry>
    <title>RE: How to send mail and attachment file using jsp</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118824696" />
    <author>
      <name>Sapphire Accountants</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118824696</id>
    <updated>2020-03-30T09:17:14Z</updated>
    <published>2020-03-30T09:17:14Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;%@ page import = "java.io.*,java.util.*,javax.mail.*"%&amp;amp;gt;
&amp;amp;lt;%@ page import = "javax.mail.internet.*,javax.activation.*"%&amp;amp;gt;
&amp;amp;lt;%@ page import = "javax.servlet.http.*,javax.servlet.*" %&amp;amp;gt;
&amp;amp;lt;%
&amp;amp;nbsp; &amp;amp;nbsp;String result;

&amp;amp;nbsp; &amp;amp;nbsp;// Recipient's email ID needs to be mentioned.
&amp;amp;nbsp; &amp;amp;nbsp;String to = "abcd@gmail.com";&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Sapphire Accountants</dc:creator>
    <dc:date>2020-03-30T09:17:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to send mail and attachment file using jsp</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111603794" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111603794</id>
    <updated>2018-11-20T11:47:16Z</updated>
    <published>2018-11-20T11:47:16Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Gemma555 alex:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;I want to send email using jsp. I have
      develop this small code to send email. I have added all require
      library like java mail API and JAF. But still it is not working. I
      don't know whats going wrong in this. it shows me Error: unable to
      send message.&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;
  &lt;br /&gt; First, a JSP is certainly not the right place to send a mail.&lt;/p&gt;
&lt;p&gt;On top of that: Without seeing any code, it's impossible for anyone
  to tell you what's wrong with your code. Please post some reproducable
  sample of your code in order for anyone to be able to help you&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2018-11-20T11:47:16Z</dc:date>
  </entry>
  <entry>
    <title>How to send mail and attachment file using jsp</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111600486" />
    <author>
      <name>Gemma555 alex</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111600486</id>
    <updated>2018-11-20T09:09:06Z</updated>
    <published>2018-11-20T09:09:06Z</published>
    <summary type="html">&lt;p&gt;I want to send email using jsp. I have develop this small code to
  send email. I have added all require library like java mail API and
  JAF. But still it is not working. I don't know whats going wrong in
  this. it shows me Error: unable to send message &lt;style
  type="text/css"&gt;&lt;![CDATA[td {
	border: 1.0px solid rgb(204,204,204);
}
br {
}
]]&gt;&lt;/style&gt; .&lt;/p&gt;</summary>
    <dc:creator>Gemma555 alex</dc:creator>
    <dc:date>2018-11-20T09:09:06Z</dc:date>
  </entry>
</feed>
