Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to send mail and attachment file using jsp
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 .
Gemma555 alex: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.
First, a JSP is certainly not the right place to send a mail.
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
<%@ page import = "java.io.*,java.util.*,javax.mail.*"%>
<%@ page import = "javax.mail.internet.*,javax.activation.*"%>
<%@ page import = "javax.servlet.http.*,javax.servlet.*" %>
<%
String result;
// Recipient's email ID needs to be mentioned.
String to = "abcd@gmail.com";
Community
Company
Feedback