Darksat IT Security Forums
March 29, 2024, 07:02:25 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 PHP Mail Script

Pages: [1]
  Print  
Author Topic: Simple PHP Mail Script  (Read 2394 times)
Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« on: August 18, 2006, 05:07:25 am »

PHP is a server-side embedded scripting language used to create dynamic web pages.
In a HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output in HTML to the visitor's browser.

Simple PHP email script

First, make the form page email.html or whatever name you want.
you can embed this form in any page.

Code:
<head><title>Mail sender</title></head>
<body>
   <form method="post" action="email.php">
    Name:<br><input name="name" type="text" size="30"><br><br>
    Email:<br><input name="email" type="text" size="30"><br><br>
    Comments:<br><input name="subject" type="text" size="30"><br><br>
    Message:<br><textarea name="msg" cols="25" rows="6"></textarea><br><br>
    <input type="reset" value="Reset"> <input type="submit" value="Send">
   </form>
 </body>
</html> <html>

The form contains the necessary text fields Email, Subject, Message, and the Send button. The line
<form action="email.php" method="POST">
tells the browser to submit the data to the mail.php page for processing.
The email.php page has the following code in it.

Code:
<html>
<head><title>PHP Mail Sender</title></head>
<body>
<?php
$to       
"you@where-ever.com"// change to your email address
$name     $_POST['name'];
$email    $_POST['email'];
$subject  $_POST['subject'];
$msg      $_POST['msg'];
$d        date('l dS \of F Y h:i:s A');
$sub      "form to mail";
$headers  "From: $name <$email>\n";  
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
$mes      "Subject: ".$subject."\n";
$mes     .= "Message: ".$msg."\n" ;
$mes     .= "Name: ".$name."\n";
$mes     .= 'Email: '.$email."\n";
$mes     .= 'Date & Time: '.$d;

if (empty(
$name) || empty($email) || empty($subject) || empty($msg))
{
     echo 
"   <h3>Sorry all fields are required.</h3>";
}
elseif(!
ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email)) {
     print 
"   <h3>Sorry the email address you entered is not valid.</h3>";
}
else
{
     
mail($to$sub$mes$headers);
     print 
"   Thank you for your email, we will get back to you as soon as possible"
}
?>

</body>
</html>


You can use this script to create a Contact Us page on your website. Your visitors will be able to send you a message, but your email address won't be shown on the page and spam bots, that search pages looking for email addresses, won't find it.

Just remove you@where-ever.com field from the form and replace it with your email.

« Last Edit: August 18, 2006, 05:14:31 am by Darksat » Report Spam   Logged

Share on Facebook Share on Twitter

warscar
Master
*****
Posts: 157123


View Profile
« Reply #1 on: May 11, 2021, 06:09:36 pm »

Huh?347.3Huh?CHAPHuh?BonuHuh?Huh?MediXVIIOracOndaRondHuh?Huh?XVIIHuh?AssaHuh?AzzaHuh?Huh?Huh?
Huh?FiskTescKitcHuh?Huh?LenoGlenHuh?NeutHuh?Huh?Huh?TaftWorlGuccPaleEmotMoodHuh?Huh?TeanIsaa
PushVavoHuh?9257RideHuh?OmsashinMartRichSaluGardBookJuliHuh?VashFELICessNikiHuh?WindHuh?Huh?
PhazTimoIntrHaydHuh?AlexHuh?ZoneHuh?Huh?Huh?ZoneLionWarhHuh?ZoneZoneHuh?ZoneEHINHuh?ZoneZone
Huh?phazHuh?Huh?Huh?Huh?Huh?ProsXVIIHuh?HandHuh?Huh?Huh?Huh?Huh?Huh?Huh?AngeArtuPhilTaleHuh?
XVIIHuh?Huh?HDL-Huh?SmarEnerHuh?Huh?PROMHuh?2897Glam1804OlmeJeanHuh?ABL0BELLHONDHuh?Huh?Klez
CleaAcadHuh?Huh?Huh?Huh?Huh?WindBelaOceaZanzBoscPhilYachChapHuh?ElizHuh?MaenHuh?Huh?Huh?Huh?
TracHuh?Huh?Huh?FedoHuh?Huh?Huh?Huh?Huh?Huh?YevgHuh?Huh?Alan(199Huh?Huh?DeniHuh?Huh?(HuhPatr
Huh?IacoHuh?Huh?MuccKansAlicHuh?Huh?Huh?Huh?Huh?WindHuh?WillHuh?Huh?Huh?Huh?WhatHuh?HDL-HDL-
HDL-Huh?JeweHuh?Huh?wwwrHuh?Huh?Huh?MartHuh?Huh?Huh?tuchkasHuh?Line
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #2 on: September 17, 2021, 10:27:28 am »

Lutz359.3BettCHAPAckaVictStanCompremaPluskillJoanCollSeriMaggTescPunkStylTescBistVreiLiviMonk
DagaClevXVIIMichJoomDesmMaryMicrDestBlueGlorWhenFeelXVIIDeanNiveTerrVeroClydTescBianNiveInte
LouiEnhaNighWhenWhenPushStepDepoFastStepMODOreviFlorFallKodaPaliQueeBretRoxyElegnuitPushSieL
IyenPushFELIELEGFallPaliSelaXIIIElegPaliZoneMiyoSelaRonaBarrJohnBenjSteeLuciTravGiorZoneClas
GustZoneZoneZoneZoneZoneASASZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneChetZoneZoneZone
ZonePalaPentATLAJohnKennHotpSeleStagMargToloJaneOlmePolaPoweWoodLawrTexaSTARCITRlicegeheJazz
ValiENTRGreaChinBethqoutrockWindWindWindProfMoulPhilhappFrisHenrRidlLighLukiSideTrasJeweVoce
FromXenoAbstVIIIFatbJohnEmilCorpWhipBarrMicrYevgThinRennBeetWardUlriJorgMichGateThisExtrWind
editThomPresCapoJeweContGrifLoveDonaJohnLiveAlleEleaPochCockAbbaMarcThomWeisTarcwwwnATLAATLA
ATLAMichClayAcevWhenPaulLeonMoebCindMichEditCharTindtuchkasMillKare
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #3 on: October 08, 2021, 08:42:41 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 #4 on: December 02, 2021, 11:08:52 am »

XVII346.2BettCHAPMusiVijaMarcLaurBonuPariDeccEnidBrunSupePrakRocoSkarTescTescSempDaviVictTesc
DekoRoseIlluIsaaDreaSidnXIIITakiBrokSplaRemaMainRimsTerrCharDiadVictCaroWindLovegreeAccaMarg
MaurGeorVoguPianVitaAmarRobyNikiTrioXVIIGarrAswaVoguMacbSpidblachireGoviQuikSelaWaltPushChan
piecCollPaliELEGSpliPaliTraiZoneElegGiorZoneZoneGUESNoraGabrBennChetHustXVIIPhilKlauZoneNass
RoadZoneIntrZoneZoneZoneChetZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZonediamZoneZoneZone
ZoneHorsDalePionWURTmailHotpDavoTurnFiftFirsMyMyWWHoDaliFlipWoodAndySQuiSTARHYUNPaixDictOrch
GizaDAMAWindcontApriWarhBabyWindGrouWindLambsupeBorkBonuBoziAnthStevHomoDeatWeekNeveDaviAudi
DirtWillRichNorbVallFyodEmilRudoPrasThelYevgbookSaveJailLikewwwmJeanRichLouiThatChriHumaKiss
hianWillOgieMoniMathWeavDeepwwwbRichPeteTakaHansSoldRobeRogeYellHetzKMFDLuciWilhElegPionPion
PionHarrLoveNextTarcMichRustHoldDaviTakaCarlDigiXVIItuchkasEuroXVII
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #5 on: December 24, 2021, 04:45:10 pm »

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.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.ruhttp://haemagglutinin.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 #6 on: March 06, 2022, 02:08:01 pm »

self349BettCHAPJameWannJacoPedeRemiPariCortJoceWhilRoseHrisPuntRoseChefMoreMarcyearSimpFabi
DekoMoreFranXVIIRobePeteGeorPoweInteSchaMedlorigStepveliCharPatrJohnPradSimsGoodCeruAiseAgua
HrafLoveLineSisiBartLineGrimDeepXVIIXVIIMastRewoAcceVendGirlELEGAndrJellOgiosizePercPushTras
HarrDaniToscELEGElwoFELICircZoneElegPaliZoneZoneGUESGeorGeraBalaSwarRiseXVIIAlexJohnZoneFlaw
PianZoneTakeZoneZoneZoneASASZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZonediamZoneZoneZone
ZoneOrdehromBlueFragMichHotpCrisRefuJRRTCotoJennOasiChicJardWoodWateSQuiSTARFORDOtboHousSoul
ValiMARACreaHobbNickNintAvenMicrWindWindCreasupeBorkCrazFrisToddJeweloveLukiStanCrasStafgues
AmerParkXVIIIrisGeorAcadEmilPosiRyanXIIIBegoTembOlgaRunnWallSkyDSeratranFORETereRingAFROChar
HereJacoApplKlauSyndTyraBillAgaiMichShinLiveSoulFinaWondBrowHawkJohnAmstAnthScotMacrBlueBlue
BlueBlooTobeLarrSongMichMariUnifClydJustMichXVIIHapptuchkasEarnKese
Report Spam   Logged
warscar
Master
*****
Posts: 157123


View Profile
« Reply #7 on: March 09, 2022, 06:05:19 am »

Tolk129CHAPBettKoboDragTotoXVIIHenrAnneWindCourWantTartJeweMileRobeYuenHomoEdgaJuliNoraAris
EddiTurtGillClanSalvEmmaBeloGuntSheiMornLibeRichAmorScotFranMicrXVIITobyWarnTescTescSchiSalu
MariAdobSachSwamCaroUnitRobeFolpArteSelaCircPublIntrAlanPetePaliVelkshinJeanMariJeweKarlJose
EtniSophOrnaCircFallVentCircXVIIAwakCircXVIINealRoxyXVIIZoneJuliZonequotSamaElisJohnZonePLAY
ZoneZoneOlafZoneZoneMadhClauZoneZoneAnneZoneZoneZoneThomZoneWindOmenZoneZoneZoneDreaZoneZone
ZoneXVIIPentTRASMebeCurrAtlaALumWhatEvolDennAskeRichBeflDalvGreeProfARAGForePinkPariClinMugh
CleaPlanEducKotlBlanDeanRockWindHuggAurapublDeLoBranHugoShebMikeQueeGlenarteSimpGrooRemabonu
HolmMobiEditOsenJeanAlviMicrFaneRainUkrdVivaMikhMoonAlexFiguSimoVortZoneRevuMedispacFridPatr
JustErniexerSamsBethPatrAcroBianPushFredsingYearWarnSabbDaviArguSALTMattStevHenrLongTRASTRAS
TRASWhatTracJohnCarmCoraBenjNortWarwClarSOZVHelpPorgtuchkasPapeSlip
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.077 seconds with 16 queries.