Please help me to use javamail to send mail in servlet program
hi
i want to send simple mail from user [email protected] to user [email protected] using servlet program
i can't compile the javamail demo program servlet "JavaMailServlet.java".
i have this exception
Note: SendMailServlet.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
i don't no how to do
please help me if you have code
thank's
Given that you're having problems with your [url http://forum.java.sun.com/thread.jsp?forum=43&thread=536278&tstart=0&trange=30]demo mail code as well as your demo servlet code, perhaps you would be better served by learning about JavaMail, servlets, and perhaps Java in general (for example - the meaning of deprecated). Then you may be able to build your own servlet for handling mail or at least will be able to revise the demo code found elsewhere.
Of course, if the purpose is really not to learn how to use Java, JavaMail, servlets, etc. but to simply create something that works then you could always hire someone to write the program for you.
This is not intended to be rude or anything - just an observation and some food for thought.
∞ brewman ∞
Similar Messages
-
Please help !! Contact form not sending mail
www.concretegta.com
in the contact us page i have made a little contact form, but i am not recieving mail to my email. Can someone please help, http://www.concretegta.com/contact.html is where the form is.
this is the coding for the php
<?php
$mailto = '[email protected]' ;
$subject = "Feedback from General Concrete Solutions" ;
$formurl = "http://www.concretegta.com/contact.html" ;
$thankyouurl = "http://www.concretegta.com/emailsent.html" ;
$errorurl = "http://www.johnsmith.com/oops.html" ;
$email_is_required = 1;
$name_is_required = 1;
$comments_is_required = 1;
$uself = 0;
$forcelf = 0;
$use_envsender = 0;
$use_sendmailfrom = 0;
$smtp_server_win = '' ;
$use_webmaster_email_for_from = 0;
$use_utf8 = 1;
$my_recaptcha_private_key = '' ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
define( 'MAX_LINE_LENGTH', 998 );
$headersep = $uself ? "\n" : "\r\n" ;
$content_nl = $forcelf ? "\n" : (defined('PHP_EOL') ? PHP_EOL : "\n") ;
$content_type = $use_utf8 ? 'Content-Type: text/plain; charset="utf-8"' : 'Content-Type: text/plain; charset="iso-8859-1"' ;
if ($use_sendmailfrom) {
ini_set( 'sendmail_from', $mailto );
if (strlen($smtp_server_win)) {
ini_set( 'SMTP', $smtp_server_win );
$envsender = "-f$mailto" ;
$fullname = isset($_POST['fullname']) ? $_POST['fullname'] : $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) {
header( "Location: $errorurl" );
exit ;
if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) {
header( "Location: $errorurl" );
exit ;
if (strlen( $my_recaptcha_private_key )) {
require_once( 'recaptchalib.php' );
$resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
if (!$resp->is_valid) {
header( "Location: $errorurl" );
exit ;
if (empty($email)) {
$email = $mailto ;
$fromemail = $use_webmaster_email_for_from ? $mailto : $email ;
if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
$messageproper =
"This message was sent from:" . $content_nl .
"$http_referrer" . $content_nl .
"------------------------------------------------------------" . $content_nl .
"Name of sender: $fullname" . $content_nl .
"Email of sender: $email" . $content_nl .
"------------------------- COMMENTS -------------------------" . $content_nl . $content_nl .
wordwrap( $comments, MAX_LINE_LENGTH, $content_nl, true ) . $content_nl . $content_nl .
"------------------------------------------------------------" . $content_nl ;
$headers =
"From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.16.2" .
$headersep . 'MIME-Version: 1.0' . $headersep . $content_type ;
if ($use_envsender) {
mail($mailto, $subject, $messageproper, $headers, $envsender );
else {
mail($mailto, $subject, $messageproper, $headers );
header( "Location: $thankyouurl" );
exit ;
?>>? i dont understand why there would be secuirity
>risks... did i do something wrong??
Most of the time McAfee SiteAdvisor gets it right but it's not perfect. It's possible there is something suspicious on your site but if you think everything is ok request a review:
https://www.siteadvisor.com/analysis/recommendchanges/?url=http%3A//www.concretegta.com/ -
Please,how can I use javamail to implementing draft box on webmail
please,how can I use javamail to implementing draft box on webmail
I already can send and receive EMail ��create
subfolder with javamail in imap server.but I don't
know how implement draft mailbox with webmail .
please expert help me . thanksyou can only create subfolders in a imap mail server ,and you can use folder class included in javamail api to access,create,modify and delete subfolders.You also can create subfolders under a subfolder as you want.
the simple example is:
//first create mail session
mailSession=...
// second create mail store
mailStore=...
//third get root folder
IMAPFolder rootFolder = (IMAPFolder)mailStore.getFolder("INBOX");
if ((rootFolder==null)||(!rootFolder.exists())) return false;
//finally create a subfolder "outbox" under root folder "inbox"
IMAPFolder tmpOutFolder = (IMAPFolder)rootFolder.getFolder("OUTBOX");
if (tmpOutFolder==null) return false;
//if the target folder not exist just create it
//note:when you create a subfolder you can assign its attribute.Details,please read the javamail document.
if(!tmpOutFolder.exists()) tmpOutFolder.create(Folder.HOLDS_MESSAGES); -
I want to change my apple id password but I forgot the security questions please help me some using my icloud I'd and if confirmation is must so please phone number is mine please send a code please help me my apple
Welcome to the Apple community.
If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do. -
Will someone please help me set-up Acrobat to send a PDF via webmail? Acrobat returns a message "Server Connection Error .... Port 143 unavailable"
Are you using a Microsoft or Apache web server? If so, you can submit to a server-side script, which will bypass web mail and client-side email software such as OUTLOOK.
For examples:
http://www.nk-inc.com/software/pdfemail.net/examples/ -
I cant find the link on my phone to update. please help i cant use my phone at all
i need to update my phone, when i go to settings, general, then update it sends me to this website in my web browser app. this is not what i need. please help.
Then update using iTunes.
-
My iPhone 4 will not sync my new voice memos from the "Voice Memos" app to my computer. This is frustrating, should not be so hard, can someone please help. I use PC with windows 7 with iPhone version 6.1.3 and iTunes most recent. Thanks.
In the Music tab of iTunes, do you have 'Include Voice Memos' checked?
-
After installing iPhone Configutilities in my Mac, Personal Hotspot using USB is not working! Please help, I am using 10.7 Lion OS
Did you talk to your carrier?
-
When I instaled new verson my Iphone4 stoped, in the sight shows the Itunes symbol. I tried to connect to Itunes, but can't repair. MISTAKE 3004. What can I do? I'm brasilian and don't speak english very well... Please, help me. Use my e-mail. Junara
<Personal Information Edited by Host>Hello Junara1969,
Thank you for contacting Apple Support Communirties. I have a couple of articles for you to take a look at to troubleshoot your issue.
I would start with basic troubleshooting
Resolve iOS update and restore errors in iTunes
http://support.apple.com/kb/TS1275
If you are still having the same issue, then there are further steps for this specific error code here:
Resolve specific iTunes update and restore errors
http://support.apple.com/kb/TS3694
Regards,
Jeff D. -
Few days back I installed Autocad 2014 in my macbook pro 15" early 2012.For few days it worked fine but since last two days I'm getting graphical lag in my mac. Finger gestures and dock movement all seems to be lagging badly.Please help.I'm using mavericks
We regularly use Cocktail by Maintain software. You run the whole gamut of options but the important one is in System - Databases - Rebuild launch services. Also in Files - Caches - then clear the lot.
This is just houskeeping really but there are so many 'links' in A/cad it needs 'cleaning' -
Sign into iCloud pop-up message on iPad2 won't disappear off screen, have reset password multiple times but it is saying incorrect. Please HELP unable to use iPad as message appears every few seconds, iPad was working fine until now.
After the restore did the phone work properly for a while? Say, a day or so?
If so it is possible you have an app that doesn't let go of memory properly. I reboot my iPhone ( hold sleep/wake and hole till you see the apple logo) every few days. This resets the memory. The iPhone OS has doesn't seem to mange memory very well yet. So a reboot will help with that. I have had my phone almost slow to a stop before I started rebooting. Always reboot after installing a new app. Also do you close all pages in Safari when you are done? This is a good practice. Safari will run in the background and use processor time and drain your battery quicker. Create a new blank page then close all others when you are done browsing for a while. I have also found that certain web site that have animated images like weather maps will turn the phone into molasses. As soon as i close that page it gets faster.
If all of the above have no effect then as Tamara said it is time for a trip to the Genius bar.
Good luck -
How to use FM SO_DOCUMENT_REPOSITORY_MANAGER send mail with CC.
Dear Experts:
Please help me. How to use FM SO_DOCUMENT_REPOSITORY_MANAGER send mail with CC.
My Program code is as follow:
*Send the mail.
tb_receipients-recnam = 'BAITZ'.
tb_receipients-recesc = 'B'.
tb_receipients-sndex = 'X'.
tb_receipients-att_fix ='X' .
APPEND tb_receipients.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = wa_method1
office_user = wa_owner
ref_document = wa_ref_document
new_parent = wa_new_parent
IMPORTING
authority = wa_authority
TABLES
objcont = tb_objcnt
objhead = tb_objhead
objpara = tb_objpara
objparb = tb_objparb
recipients = tb_receipients
attachments = tb_attachments
references = tb_references
files = tb_files
CHANGING
document = wa_document
header_data = wa_header.
endform. " send_mail
By the why, tb_receipients-recnam = 'BAITZ'. What's the meaning of 'BAITZ'? Thanks!you can use FM SO_NEW_DOCUMENT_SEND_API1
WA_RECV TYPE SOMLRECI1,
IT_RECV TYPE STANDARD TABLE OF SOMLRECI1.
wa_recv-receiver = 'TO email address'.
wa_recv-rec_type = 'U'.
wa_recv-com_type = 'INT'.
APPEND wa_recv TO it_recv.
CLEAR wa_recv."To Recipient
wa_recv-receiver = 'CC email address'.
wa_recv-rec_type = 'U'.
wa_recv-com_type = 'INT'.
wa_recv-copy = 'X'.
APPEND wa_recv TO it_recv.
CLEAR wa_recv. "CC Recipient
wa_recv-receiver = 'BCC email address'.
wa_recv-rec_type = 'U'.
wa_recv-com_type = 'INT'.
wa_recv-blind_copy = 'X'.
APPEND wa_recv TO it_recv.
CLEAR wa_recv. "BCC Recipient -
How to send mail from servlets
m having troubles sending mail from servlets...
how do you use the SimpleMailUser object needed in the session?
a sample code on this would be of great help, thanks!<html>
<body bgcolor="white">
<font size=5 color="black">
<%@ page import="javax.servlet.http.HttpUtils" %>
<%@ page import="java.util.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.io.*" %>
<%@ page import= "sun.net.smtp.SmtpClient" %>
<%
String from,to,subject,msgbody,serverName;
try
from = request.getParameterValues("from")[0];
to = request.getParameterValues("to")[0];
subject = request.getParameterValues("subject")[0];
msgbody = request.getParameterValues("msgbody")[0];
serverName = request.getParameterValues("server")[0];
catch (Exception e) // Generally Speaking, an Error getting one of these
// Values means that it wasnt passed in; inform the user
out.println("You must call this JSP from this ");
out.println("<A href=\"FormMail.htm\"> form</A>.<BR>");
out.flush();return;
%>
Hold On A Moment while I try to Send Your Mail... <BR>
<%
out.flush();
// Here are the real guts of the mail sending
try
sun.net.smtp.SmtpClient sm = new sun.net.smtp.SmtpClient(serverName);
sm.from(from);
sm.to(to);
PrintStream msg = sm.startMessage();
msg.println("To: "); // Note dont use + for Performance
msg.println(to);
msg.println("Subject: ");
msg.println(subject);
msg.println();
msg.println(msgbody);
msg.println("==============");
msg.print("This mail brought to you by JSP MAIL..from a user at IP ");
msg.println(request.getRemoteHost());
sm.closeServer();
out.println("Your Mail Has Been Sent!");
catch (Exception e)
out.println("The mail couldn't be sent, probably because the mailhost wasnt set correctly.<BR> ");
out.println("The error message I am getting is: ");
out.println(e.getMessage());
%>
<BR>
<BR>
Click here to send another! -
HI
I have 2 IPads, I am unable to use one of it because I have forgotten my pass code and also logged out from iCloud accidentially. Can you please help me to solve this problem.
Cheers
RaveenaFollow the instructions on this page : Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
-
PLEASE HELP! I use 1 track, and i get an alert saying "too many tracks"
i just bought brand new MacBook Pro 2.16 with an extra Giga in RAM (2.0)...
I use Garageband 3.0.4 (and no other application running) and im making a project with 4 very simple tracks (no effects and plug-ins). When i run the project for the first time i always get a message saying that im using a lot of software tracks! (its impossible, im sure is not a matter of number of tracks, nor a power issue). I have the buffer size at the highest level...
should i re-install mac-os x?
please help, y really need this software... was my reason to buy the computer, and is not working at all!so most of the artists and djs that play live with
mac computers... use external drives??
Most don't use GarageBand. DJ would use DJ software, and a musician might use GB as his synth, but not many people would do what you're trying with GB.
this is my first mac experience
Blame GB rather than the Mac, for all its eye candy and ease of use, it is a resource hog.
other mac users doesnt seem to have the problem that
i do... could it be just an error in my software??
Actually I've seen this question posted many time, so others do have similar probs. Unfortunately it's really impossible to guess why one person has trouble and another doesn't. I was doing 12 tracks easy, with half your machine (but en external drive). I've seen posts where people complain that they can't record 1 track without an error. Without having the machine in front of me, it's just not possible to guess why B-(>
error that could be fixed with a reinstlation??
I doubt an reinstall would help. You might try running your Activity Monitor app to see what processes are running and using what resources.
<hr width="250" align="left">
HangTime [Will Compute for Food] B-)>
♪♫ The Bullets and Bones Band ♫♪
Disclaimer<hr width="250" align="left">
Maybe you are looking for
-
How do I use user_datastore with a feeder proc to add an mdata section?
Hi, I have text data spread across a number of different tables. I have created a user_datastore with a feeder procedure that creates an xml document which is then indexed into a dummy column on the parent table. This works fine. However I need to ad
-
HT4976 how can I use emoji keyboard on iPhone 3GS????
how can I use emoji keyboard on iPhone 3GS In wts app nd version ov this is 5.1.1(9B206)????????
-
When I open the Color Themes panel in Illustrator CC (2014.1.0 Release), and click the "refresh" button, it only pulls in the themes I had saved on the web back when it was "Kuler." No new themes that I make (that show up on the web under "My Themes"
-
I don't know what to do... I lost my YouTube and my App Store is weird and I want my old App Store and YouTube back.
-
How to list current password policy
Hello all, This is my first post here. I just finished the DBA Workshop 1 course and my company is migrating from 8i to 10g. Our primary DBA is on vacation and before he left asked me to look at the new 10g install he did in our test environment. I n