Home Answers Viewqa JSP-Servlet sending a mail

 
 


harini
sending a mail
1 Answer(s)      3 years and a month ago
Posted in : JSP-Servlet

I m writing a code for send mail in jsp,i sending a mail to specified receiver but if i attach an file and send a mail then i m getting an error.

Here Attachment is in String[] Attachment=null so how to convert from string to String[]
here is whaString[] i have done

//In html...
Attach :<br>
<input type="file" name="file" ></input><br>

//In jsp...
String strFileAttachment = request.getParameter("file");
String[] Attachment=null;
MailObject mailObject = new MailObject();//this a java class

PrintWriter printWriter = response.getWriter();
isSuccess = mailObject.sendMail(strFrom, strTo, strCc, strBcc,
strSubject, strMatter, printWriter);
mailObject.sendMailWithAttachment(strFrom, strTo, strCc, strBcc,
strSubject, strMatter, printWriter,Attachment);


please tell me if any changes..

thanks in advance..
View Answers

April 22, 2010 at 11:32 AM


Hi Friend,

Please visit the following link:

http://www.roseindia.net/javamail/SendAttachment.shtml

Hope that it will be helpful for you.

Thanks









Related Pages:
sending mail - JSP-Servlet
sending mail  Hi, what is the code for sending mail automatically without user intervention? thanks in advance
sending mail using jsp
sending mail using jsp  please give me the detailed procedure and code for sending mail through jsp program   Please visit the following links: http://www.roseindia.net/ejb/introduction/j2eedemo.shtml http
java mail sending with images
java mail sending with images  I need to send images through java mail without giving content path(i.e. we don't want hard code the image path)can you tell me the idea?   Please visit the following links: http
sending a mail - JSP-Servlet
sending a mail   I m writing a code for send mail in jsp,i sending a mail to specified receiver but if i attach an file and send a mail then i m getting an error. Here Attachment is in String[] Attachment=null so how
iphone mail sending problem
iphone mail sending problem  Hi, I'm receiving the following error ... while sending mail in my iphone application Terminating app due to uncaught... it done myself... actually in my send mail code i have predefined the mailto id
Sending mail - JavaMail
Sending mail  Need a simple example of sending mail in Java  Hi,To send email you need a local mail server such as apache james. You first download apache james mail server and install on the local network.Then create
Sending images through java mail
and by clicking one image the control go to mail sending page in that the image should add to body part and the mail will sent to recipients..... please give me any idea...Sending images through java mail  Am trying to develop greeting
Sending mail (Contact Form in a website)
Sending mail (Contact Form in a website)  Hi, I just uploaded few of my webpages into a free web hosting service, where i can just upload the web pages. Am very much new into this field. I want to write a contact form, which
sending mail with attachment in jsp - JSP-Servlet
sending mail with attachment in jsp  Hi Experts
sending mail with attachment in jsp - JSP-Servlet
sending mail with attachment in jsp  Hi, Can any one pls tell me how to send email with attachment in jsp. I know how to send mail without attachment but with attachment its not working for me. If u hve any idea please
values of the "from address & to addresses" while sending a mail to localhost using javamail
values of the "from address & to addresses" while sending a mail to localhost... in JavaMail in ur website.I tried 1st program for sending the Mail.It's... is,What i have to mention in from address field and To address filed while sending
Email queue while sending mail using Struts Class
Email queue while sending mail using Struts Class  Can I maintain a queue of mails being sent from a JSP page in a DB to get its status
Email queue while sending mail using Struts Class
Email queue while sending mail using Struts Class  Can I maintain a queue of mails being sent from a JSP page in a DB to get its status
sending mails - JSP-Servlet
sending mails   sending mail using smtp protocal ,while running,i got error an javax.mail.sendfailed exception. what is this error
Sending email without authentication
/mail/sending-an-email-in-jsp.shtml...Sending email without authentication  Hi sir, Am doing a project in JSP, in that i want to send mail without any authentication of password so send
mail with multiple attachments
mail with multiple attachments  code for sending mail with multiple attachments in jsp
Sending Emails In Java
Sending Emails In Java  I want to send emails from within a java program. I saw some online java programs to do that, but they needed me to enter... with how to write the code?   Please visit the following link: Java Mail
Sending Emails In Java
Sending Emails In Java  I want to send emails from within a java program. I saw some online java programs to do that, but they needed me to enter... with how to write the code?   Please visit the following link: Java Mail
Sending Emails In Java
Sending Emails In Java  I want to send emails from within a java program. I saw some online java programs to do that, but they needed me to enter... with how to write the code?   Please visit the following link: Java Mail
mail problem
for sending mail!"); } catch(Exception e){ out.println(e.getMessage...mail problem  Sir, I tried ur send mail example but it giveng...; <title>Mail API</title> </head> <body><table
php send mail with attachment
php send mail with attachment  Syntax of sending email with attachment in PHP
java mail
(); out.println("Thanks for sending mail!"); } catch(Exception e
regarding sending mesage - JavaMail
regarding sending mesage  i have tried the following program... properties = System.getProperties(); // Setup mail server... me in this regard   Hi friend, I am sending you a link
sending email code - JSP-Servlet
sending email code  How To Send Emails using jsp  Hi friend, I am sending you a link. This link will help you. Please visit for more information. http://www.roseindia.net/mail/sending-an-email
Cheking birthday excel sheet everyday and Sending Automated MAIL to birthday boy on his birthday
Cheking birthday excel sheet everyday and Sending Automated MAIL to birthday... anyone help me out in the procedure for sending automated mail to the birthday... = systemdate, 2) Auto mail should be sent to paticular person with all the other
Sending an email in JSP
Sending an email in JSP       Sending an email in JSP In this section, you will learn how to send an email in jsp.   Following is a simple JSP page for sending
Sending email with read and delivery requests
Sending email with read and delivery requests  Hi there, I am sending emails using JavaMail in Servlets on behalf of a customer from the website..., Gareth   Please visit the following link: JSP Servlet Send Mail
when sending the mail from java I am getting the below error - JavaMail
when sending the mail from java I am getting the below error   when sending the mail from java I am getting the below error : Exception... not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/mail/mail.jar,file
java mail programs
java mail programs  I got some codes from this about sending mail,forwarding mail,multipart mail etc..and I compiled and executed it,but it did... output.actually,do I need a mail server to get correct output of these codes?plz help me, I
java mail api - JavaMail
and Tutorials on Mail visit to : http://www.roseindia.net/mail/sending-an-email...java mail api  Hi, Pls give me the detailed information on how... points : 1.Download the Apache Mail server (James) http://james.apache.org
mail api - Development process
mail api  hi to all, it,s abhishek................. actually i am using mail api for sending the mail with attachments(audio and video)..... suppose i am sending a video which will be open on real player 3.21.. so i wants
send mail using smtp in java
send mail using smtp in java  How to send mail using smtp in java?   Sending mail in JSP - SMTP
send the mail with attachment - Struts
send the mail with attachment   Hi Freinds, i am sending the mail without attachment file now. But i need to send the mail with attachment... the mail . Mail Problem is file path: how to get the file path from the browse("we
E-mail Tutorials
E-mail Tutorials       Sending an email in JSP In this section, you will learn how to send
java mail - Java Beginners
java mail  how to send a mail without authentication one domain....  Hi, You have to use the Java mail api. You need to use the SMTP... is tutorials on Java Mail API: http://www.roseindia.net/javamail/index.shtml http
JAVA MAIl - JavaMail
JAVA MAIl  Hi, I am trying to send a mail using java mail api. But I am getting following error: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: Could not connect
why mails are sending from the linux server - JavaMail
java application,mail are not sending .Mail server is installed on windows 2003...why mails are sending from the linux server  Mails are not sending from the linux server.We have 3 systems. server system is windows 2003 server
sending email using smtp in java
sending email using smtp in java  Hi all, I am trying to send and email to through my company mail server. Following is my code package com.tbss... IHGWTMEX07.SerWizSol.com Microsoft ESMTP MAIL Service ready at Wed, 21 Dec 2011 14
i have split a string by space ,done some operation and now how to properly order them for sending a mail in java or jsp - JSP-Servlet
order them for sending a mail in java or jsp  Dear sir, I have... arraylist and used that string as a argument ,passed in a sending a mail method .Now my problem is that after sent a mail when a receiver got that mail
Java Mail - JMS
, For solving the problem visit to : http://www.roseindia.net/mail/sending-an-email... running very well,creating no other problems. Now i am trying to learn java mail service. I hav written a sample mail program to just test the code.The code
mail
mail  how to send mail using jsp   Please visit the following links: JSP Send Mail Java Mail Tutorials
Introduction of Java Mail
of Electronic Mail for example- composing, reading, sending text mails and also...; Sending message using Java Mail This Example shows you... Introduction of Java Mail     
java mail API
(); out.println("Thanks for sending mail!"); } catch(Exception e){ out.println...java mail API  <html> <head> <title>Mail API<...%" cellpadding="0" cellspacing="0"> <h1>Mail API</h1> <tr>
Sending message using Java Mail
Sending message using Java Mail        This Example shows you how to send a message... = System.getProperties();   // Setup mail server   
mail
mail  I wrote a program to send mail using smtp. But there is an error message " could not connect to smtp.gmail.com port 465. what is the problem how can i solve it ...   Please visit the following link: Java Mail API
Java Mail - JSP-Servlet
Java Mail  hi, i refer ur J2EE Tutorial - Send Email From JSP & Servlet to send emails from my application.but when i run the jsp it will throw thhese exceptions. ERROR.....javax.mail.SendFailedException: Sending failed
Mail from JSP with SMTP - JavaMail
Mail from JSP with SMTP  Hi, Can any one pls guide me how to send mail from JSp page by using SMTP IP address. Regards...,Britto.M  Hi Friend, Please visit the following link: http://www.roseindia.net/mail
how to send a mail - JSP-Servlet
when a receiver gets a mail ,the matter will be shown in a single line . I am sending a following matter Dear Harini , U r bonus is 2000 . Regards Hr. But when a receiver got a this mail as a Dear Harini,U r bonus
Email - Electronic mail
is electronic mail format and API for sending, receiving and electronic mail...Email - Electronic mail In this article we will understand the E-mail and see... internet users. We prefer email over standard mail. Email is free
Introduction to Java Mail API
type of java application. Composing, reading and sending electronic mail... Introduction to Java Mail API       The Java Mail API allows the developers to add mailing

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.