Sending mail from JSP page with attachment
I have a requirement to send mail with attachment from my jsp pages, which should come to a particular mail box. Can any one help me by sending sample codes. Thankx in advance.
hi,
When request is posted you have to save file data from request to a file. you can not access the data using request.getParameter("file").
Similar Messages
-
HI Everyone,
Please help me out in this. It is very urgent so not able search the same in this forum.
I have a J2EE application. The view is in JSP. If i click a button from a JSP page, any mail client (Microsoft Outlook) has to open and current page need to be attached as html. THen user wish to send the mail to somebody...
So my aim is to open a outlook and attache the current JSP page as html. PLease help me out !Instead of outlook, you can do it easily using SMTP
-
Hello,
can some one help me to send emails from a jsp page.
and if possible the source code of jsp or java...
Thanks !read this:
http://www.jspinsider.com/tutorials/jsp/javamail/jspjavamail_1.view -
Need to Send Mail from JSP...
Dear Team,
I Need to Send Mail from JSP, have Designed user Interface to enter
to, from, subject, and message text .
Have Downloaded mail.jar and activate.jar file..... and placed in tomcat lib directory and WEBAPPS/WEB-INF/lib Directory too
How do i send a mail to user ?
do I require something else apart from things that i have mentioned?
do i have to Configure SMTP, POP3 or Something like this....
Now If I Create a object of Type MimeMessage and Set Recipient, from, subject and if i say transport.send(message) will this do My JOB???Dear Team,
I Need to Send Mail from JSP, have Designed user
Interface to enter
to, from, subject, and message text .
Have Downloaded mail.jar and activate.jar file.....
and placed in tomcat lib directory and
d WEBAPPS/WEB-INF/lib Directory too
How do i send a mail to user ?
do I require something else apart from things that i
have mentioned?
do i have to Configure SMTP, POP3 or Something like
this....
Now If I Create a object of Type MimeMessage and Set
Recipient, from, subject and if i say
transport.send(message) will this do My JOB???Yup! in addition to all the above i need to know my mail box outgoing mail server. and that's enough...... i am able to do that.
Regards,
Jagadeesh HS. -
Send mail from PL/SQL with an attachment
Hi,
Can any body help me on how to send a mail from PL/SQL with an attachment which is located on a unix system path.
This is an urgent requirement in my current project. Any quick reply would be greatly appreciated.
Thanks
Kumar.Quick reply (too bad you didn't mention your DB-version):
Check the docs @ http://tahiti.oracle.com regarding packages UTL_SMTP and UTL_MAIL
Check http://asktom.oracle.com/pls/asktom/asktom.search?p_string=%22mail+attachment%22
Check http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Check http://www.oracle-base.com/articles/10g/PlsqlEnhancements10g.php#UTL_MAIL -
Hi guys,
can anyone help me out of this problem ??
I have written a piece of code which sends mail from a jsp page.
When I use the 'Recipient'(TO) as an address in the same domain
(ie,<xxx>@<apeejaygroup.com>) it works fine.
But when I use an address such as <xxx>@<rediffmail.com>
the code gives an error like -
"javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied"
I am sending the piece of code for reference..
String host ="192.168.33.11";
String from="[email protected]";
String to="<xxx>@apeejaygroup.com";
( HERE USING THE ADDRESS AS <xxx>@<rediffmail>.com
GIVES THE EXCEPTION - javax.mail.SendFailedException: 550 5.7.1 ... Relaying denied )
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
javax.mail.Session session1 = javax.mail.Session.getDefaultInstance
(props, null);
MimeMessage message = new MimeMessage(session1);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject("Your Registration Details");
message.setContent(body,"text/html");
Transport.send(message);
Please help me out of this.
Regards
Satrajitas you said that it might require authentication
but our mail server doesn't require authentication to mail.
Now what should i do ??Many servers are now authenticating by requiring you to fetch your e-mail before sending. This is basically because most SMTP mail servers CAN NOT authenticate in the normal sense of the word. So, they use the fetch process for authentication. The fetch process already requires authentication normally. Then your IP address will be good for, say, 20 minutes, and you can relay e-mail through the server.
It works with most E-mail clients such as Outlook or Netscape, because the default behavior is to 1.Connect to the POP server, 2.Login, 3.Download any new mail, 4.Connect to the SMTP server, 5.Upload any mail to send.
Even if you don't have any mail, your IP address will at least have been authenticated. Even if you just check for mail, and not download any, you should be OK.
So what I'd suggest is that you write some code that attempts to connect to your mail system's POP server, get authenticated successfully, then try sending out the e-mail through the SMTP server. -
hi,
i want to send mail from my jsp page.
1) how can i do this
2) do i need any mail server for doin this
thanks
regards
manoji want to send mail from my jsp page.
1) how can i do this
2) do i need any mail server for doin thisRead
http://java.sun.com/developer/onlineTraining/JavaMail/
Rather,
try this:
http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html -
Send message from JSP page to Java message driven bean
Hi all
I'm using Jdev903.
I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
* I created Message Driven Bean that named: MyMessageDrivenEJBBean
* I have configed jms.xml:
<topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
<topic name="ChatTopic" location="jms/theTopic"/>
* In JSP page, my code is:
final Context ctx = new InitialContext();
// 1: Lookup ConnectionFactory via JNDI
TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
But trouble occurs is:
javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
please help me!
thank a lot.Welcome to the Sun forums.
1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
2. As far as possible, please post an SSCCE
What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html] -
Sending mail from JSP through Microsoft Outlook
Hi all,
i want to send an e-mail from JSP by clicking on link or button through Microsoft's Outlook..
Can anyone guide me..something like this,
try{
props = new Properties();
props.load(this.getClass().getClassLoader().getResourceAsStream("contact.properties"));
int i=0;
String referer = props.getProperty("contact.allow.referer."+i);
email = props.getProperty("report.email.error");
while(referer != null){
i++;
contact.put(referer, "true");
referer = props.getProperty("contact.allow.referer."+i);
}catch(Exception e){
e.printStackTrace();
try{
Session session = (Session)new InitialContext().lookup(this.props.getProperty("reports.jndi.email"));
SMTPMessage m = new SMTPMessage(session);
m.setFrom(InternetAddress.parse(this.props.getProperty("report.email.from"))[0]);
m.setRecipient(RecipientType.TO, new InternetAddress(this.email));
m.setSubject(this.getSub());
StringBuffer msg = new StringBuffer();
msg.append("Employee Name: "+fn + " " + ln +"\n");
msg.append("Employee ID: "+this.getId()+"\n");
msg.append("Message: "+this.getMsg()+"\n");
m.setText(msg.toString());
m.setReplyTo(InternetAddress.parse("no-reply"));
m.saveChanges();
Transport trans = session.getTransport();
trans.send(m);
trans.close();
}catch(Exception e){
e.printStackTrace();
} contact.properties:
reports.jndi.email=java:comp/env/globalMail
report.generation.timeout=3000
report.email.subject=Some Subject
[email protected]
[email protected] -
hi all,
Can any one help me, how can i send the mail from JSP-Servlet.
in Spring, we have a the following package to send mail,
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
Suggest me to solve the problem.
Thanx in advance.
BalaHi balu,
i already go thru that API. My problem is if i add any additional jar file for sending the mail from JSP or Servlets only. not in high technology.
i mention spring as an example.
so, kindly suggets me on that.
Bala -
Unable to send mail to multiple recipients with attachment
I'm using a script given in the Oracle page - http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt for sending mail with attachment. Although I'm able to send mail with attachment to a single user, but the same can't be done while the recipients are more than one. Can some one help me ?
Hi,
Ca you please send me an example set of parameteres that we need to pass to make this program work?
I'm not able to attach a file to this program.Can youe please let me know how I can attach a file called 'Test.txt' kept at 'D:\' to this program?
Thanks.
Bhavin -
How do I send mail link this page with iCloud
I'm having problems sending mail link from safari with iCloud please.
Please helpThere is an option to "Send Link..." in the File menu. Firefox does not have a built-in send page by email option.
-
How to send info from JSP page as email-body
Hi,
i have a JSP page that generates dynamically as a result of some query. I have a Button - "Send Email".
I want to send the information to the receipient thru email automatically on a button click,
All information is in the memory. How can we pick the info from memory and send it as a message thru email?
Pls help.
thanx & regards,
Shalinicreate a servlet to send mail (use the JavaMail api) then Post the message to the servlet when you click on the button.
OR, put the message and any other data (like the email address) into the session, and then just call the servlet on click of the button, and have the servlet retrieve the information from the session. -
Hi there,
Please excuse me if a make a few mistakes, I am French ;)
I come here because firefox and thunderbird are not working together anymore. This is what happens :
- Firefox and Thunderbird are opened
- I click on a link in an email
- A few seconds after that a Firefox windows pops up. The title is : "Close Firefox", the content is : "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."
Second case :
- Firefox is closed and Thunderbird is open
- I click on a link in an email
- A few seconds after that a Firefox windows pops up as expected. Firefox opens the link as expected but doesn't opens the other tabs as usual (when i start FF it re-opens previous tabs)
Third case :
- Firefox and Thunderbird are opened
- I click on a link to send an email (<a href="mailto:......@.....">)
- A few seconds after that a Thunderbird windows pops up. The title is : "Close Thunderbird", the content is : "Thunderbird is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."
As in the second case, if TB is closed when i click on the mailto, TB opens properly and send the email.
If Internet Explorer is set as my default browser, it works fine for "Thunderbird -> link -> IE" but the "IE-> mailto -> TB" still doesn't work.
I already looked up for some answers on google but can't find something which works.
Thank you in advance for your answers.
VincentCheck the target field in the Firefox desktop shortcut and make sure that you do not start Firefox with the -no-remote switch or have set the environment variable MOZ_NO_REMOTE=1 (Control Panel > System > Advanced > Environment variables).
Always make sure to start at least the default profile without the -no-remote command line switch.
If you need to have more than one profile open at the same time then start subsequent instances with the -no-remote command line switch.
You can not send links from other programs to a Firefox instance that is started with the -no-remote switch.
In such a case you need to drag links in a Firefox window or paste the link in the location bar. -
How to send mail from jsp pageq
Pls help me with this topic
Thanks alotCan you make it clearer. Pls give me a sample code if possible
Thanks alot
Maybe you are looking for
-
My Iphone 5 won't connect to a network or wifi
My Iphone 5 won't connect to a network or wifi, I just got the phone less then a month ago.....It is driving me nuts and I don't know how to fix it!I
-
Hello, I have a question regarding the power consumption of a Cisco 2951 router with an AC-PoE power supply (without PoE boost). In fact in the table (n°7) of the Cisco 2900 Series ISR (G2) datasheet, that sum up the power consumption data for Cisco
-
Post Author: WAFFLE CA Forum: General We use our POs to split our costs into seperate cost codes, which helps us for future costings. However, now when we send our POs to the vendors there are sometimes 20 line items for the same item. What I was hop
-
Want to show material description in WM - tcode li11n
Dear All, Anyone know how to show material description in LE-WM - tcode li11n screen? Thanks in advance Daniel
-
Unable to send message in Service bus queue through Webrole which are connected to Azure VPN
I have created two Azure VPN and two cloud services(deployed webrole) and one service bus queue First Azure VPN and cloud service(deployed webrole) is created in same affinity group. Second Azure VPN and cloud service is created in West US Service bu