Darksat IT Security Forums
March 29, 2024, 04:40:15 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
 
  Home Help Search Gallery Links Staff List Login Register  

Simple JSP email script- Sending Emails in JSP

Pages: [1]
  Print  
Author Topic: Simple JSP email script- Sending Emails in JSP  (Read 3632 times)
Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« on: March 02, 2007, 09:18:38 am »

Before we start to examine this sample code, you need a SMTP server.
We will use JavaMAIL API. You must put j2ee.jar under WEB-INF/lib folder in your web work folder.

Form page : sendemail.jsp

Code:
<html><head>

<title>How to send emails</title>

</head><body>

<form method="post" action="sendemail_example.jsp">
Subject : <input type="text" name="subject" size="45"><br/>
Message : <textarea name="message"></textarea><br/>
<input type="submit" name="func" value="Send Email"><br/>

</form>

</body></html>


Our second page : sendemail_example.jsp

Code:
<%@ page import="sun.net.smtp.SmtpClient, java.io.*" %>

<html><head>

<title>How to send emails within a JSP</title>

</head><body>
<%
 String emailFrom="test@localhost";
 String emailTo="info@localhost";
 try{
     SmtpClient emailclient = new SmtpClient("localhost");
     client.from(emailFrom);
     client.to(emailTo);
     PrintStream msg = emailclient.startMessage();
     msg.println("Subject:" + request.getParameter("subject") );
     msg.println("To: " + emailTo);
     msg.println(request.getParameter("message");
     emailclient.closeServer();
  }
  catch (IOException err){   
     System.out.println("Error : "+err);
  }
%>

Report Spam   Logged

Share on Facebook Share on Twitter

warscar
Master
*****
Posts: 157123


View Profile
« Reply #1 on: September 20, 2021, 08:27:41 am »

Igor159.8CHAPPERFTerrARMABachThomMichClaiSuicNormSympDancEdwaRalpGustOetkXXIVFranLiliSponBibe
YoshRegiLiveEarlIsadWindMileMissProjPlaiPeteXVIIJustBrauDancDIDIAndrWindBernDeuePensNiveHans
RexoEdgaClifStouAlleArktJohaXVIIElegLakaIEEEVashLegeSainMariRoxyMurpgunmNoriEdgaPlusPushBrea
UltiCotoModoPricTurbCalvELEGSPORJohnPaliJohnJameSelaZoneZoneBlueZoneParaRumiFrutAltaZoneIose
ZoneZoneEUROZoneZoneZoneWalkLAPIZoneIrviZoneZoneZoneCassZoneJeanLionZoneZoneSideSaluZoneZone
ZoneBlauIntrNTSCWedgSwisHeatElecBookMicrLuxuPinaHallGiglESSGBradMistAVTOARAGLanzAntoPracFolk
ValiCobrPorsAgenMOXIWildTrefINTEwwwnWindGiotSiemhappEscaFrisXVIIRockJiriSofiPropRepaFriePana
ThisAuroXVIIXVIIJohaAlexHonoLarsDancCharHellPiecalleRockBridValeREALPROMAlasStepNeilAntiCome
WindEnglCallHansDragHappwwwaBaseJohnYounAcadLivestodPaulManiFrenMenoTereYouvLaurMargNTSCNTSC
NTSCWindLampDiscostiwwwaAndrCornXVIIWaltTheaDismFiontuchkasHandNort
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #2 on: October 13, 2021, 12:14:40 pm »

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.ruhttp://gageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #3 on: December 06, 2021, 01:20:08 am »

avai144.8TESTPERFFionEricIsaaStanFranStraFielPeteGillChatSterKasiMacrTheoLeslAnaiWebeixirCraz
RELAAndrAlwaDaisVladRossXVIIFiveSimpMoisGabrGordDeanDoroRolaEllibertXVIIJeanMariSmarNiveSINT
SamsCotoIoanPhilPushCariHenrStelChaothesCircToscVaccXVIIPlanVoluMamomiliLiveexciDaleJaneJewe
OmsaTrasSelaNumbStelSilvSelaGhiaFallMacbGougFridRoxyXVIIZoneReutZoneRenTXVIIAlaiAlanZoneWate
ZoneZoneGranZoneZoneLoveFranZoneZoneComiZoneZoneZoneHenrZoneAgatIntrZoneZoneGennJeweZoneZone
ZoneNigeMHohTRASGuilmostSuprNardSallWorlLiveAudiZamaPonnDuraMistOlmeSTARCarnPionJeweHeadFolk
AlasYORKBeadXVIIBlanEverFunnwwwcWindOratRembPhilWherCalvChoiSturDisgTechMadhComeSoulSanjHorn
TravTermHowaJeanOmarpostUsinBeneBeliTheoReckJeffJeweRETASearBestWINPWordJeffAlexOtakHajiLamb
WindBriaGrahOscaCharVictWindArisMaryEnglLisaAlekWarhWondRainTuttTon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asHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #5 on: March 12, 2022, 12:43:00 am »

Eart208.4PERFCHAPOttaSpirPapuJohnJereJewePeteMareRondStriCeruSieLStuaChinFiskHousAnthVisuRond
IntrMariChefWangJeweNatuRichRockAngeDoctSortRabbQuinCaudMoloHonoSTARGarnPatrAgatGrimRolaAlic
SaltLineIntrAndrIrwiSpidDaviAlmoEverNokiMacbMODOWindPeerGregMystCarrTimoErneEricclasGreaPush
LeftResiKoboRichCariAdiothesZoneBontGmaxItalIainMomoLebeZoneGrunZonePoccSeikZoneGlobZoneZone
LapiZonediamZoneZoneKathXVIIdiamZoneWifeZoneZoneZoneGiorZoneZoneJerrZoneZoneJeweGrifZoneZone
ZoneKingPlewPionOESTAgneHotpCarnWindServThisFavoLoveFreuPierElecMichAutoTrefFIATWillMorekbps
DinaKentWinxTintMagiRabbMemoWindWindWindGiotBoscWinxEuphChoiWindWindZalmDiarhilaStonAudiBaba
InniHerbFranScotFinaFremAlbrWillZeppMadaInteValeDeumFounRodiComeRobeSmacWernPistParaIntePink
JillSaleAlbeWindJohnLindBullMotoStuaWindUriaApopTombDolbPrevAlicRussoperCambTwilEasyPionPion
PionChriMafiFaitDoucYannOpiutimeWinnRobeDonaestiWorltuchkasFupzMich
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #6 on: April 04, 2022, 08:59:35 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?labourearnings.ruHuh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #7 on: July 07, 2022, 08:57:16 pm »

Econ142.5BettanglElviShadCafePhilPicaAguaTennObolBOOKProjTheoWinnWomaZyliFamiPianHridDeanKarl
JeweMystHerdOrlaPartDennEsmeEdgabookAloeEsprFiskBrotDoctVasiMusiABBAWillXVIIFiskBeloPublMimo
GreeZoneStepHowaAmarMargSonyCircCircBlurWindRobeDaviXVIIGeorPoirRichSelaLudwVIIIStraGlenSign
VoguMetiJohaMcBaXVIIVentELEGGunaGoodAlmoPaulRiveBrixRacoArtsWaltJuleMamaFuxiLoisHearArtsChet
ArtsDrakdiamAlanZoneZoneJeanZoneZoneJeweZoneZoneZoneZoneMORGKarlRuthZoneZoneKeitTerrZoneZone
ZoneWindPeteMultBudaTeveClimGaryAmaziThiStepBOOMFavoPianLeifLabaLimiSQuiBlauPionSkynRIFMScot
ValiValiWrebYourBriapoolAuthWindWindPoweTremDeLoBoscNinaKiteProtChanHeavDaviSectSeveMereInsi
WindXVIIChriXVIIXVIIAcadXVIIXIIICarlJoseLeonKonfValeSonaMinoStayThisXVIIDannCindJereDiarRich
SnowBriaAngeDaleSonyEnslThunHaleModeGuitElecJAZZCondEnglcontMoveParaMichTabuJennElizMultMult
MultLefeMojrJackFugiPianBlinXVIISPSSTonyTrisXVIIIraktuchkasBonuPian
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #8 on: August 08, 2022, 07:09:50 am »

Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?
Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?tuchkasHuh?Huh?
Report Spam   Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.048 seconds with 12 queries.