Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

send mail preko php-a

[es] :: PHP :: send mail preko php-a
(Zaključana tema (lock), by Nemanja Avramović)

[ Pregleda: 4436 | Odgovora: 16 ] > FB > Twit

Postavi temu

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

danield
Daniel Dulic
Web developer, CitySu team
Subotica

Član broj: 101580
Poruke: 113
*.tippnet.co.yu.

ICQ: 443682699
Sajt: www.citysuteam.com


Profil

icon send mail preko php-a24.08.2006. u 23:08 - pre 215 meseci
Da li neko moze da mi napravi php fajl da mi mail salju preko php-a.Ja sam vec nesto napravio,ali pocetnik sam pa ne znam kako da napravim preko php-a?
[/code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Primer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="mailto:[email protected]?subject=komentar">
<table width="268" height="130" border="0">
<tr>
<td width="67" height="32">Ime i prezime: </td>
<td width="191"><input name="ime i prezime" type="text" id="ime i prezime"></td>
</tr>
<tr>
<td>e-mail:</td>
<td><input name="e-mail" type="text" id="e-mail"></td>
</tr>
<tr>
<td>komentar:</td>
<td><textarea name="komentar:" id="komentar:"></textarea></td>
</tr>
</table>
<input type="submit" name="Submit" value="Potvrdi">
<input type="reset" name="Submit2" value="Poni&scaron;ti">
</form>
Dizajn je bezveze samo da vidite na sta mislim!
</body>
</html>[/code]

--

With The Best Regards,

Daniel Dulić, Web System Development
http://www.citysuteam.com
Telefon: +381 (0) 64 / 364 - 65 - 91
E-Mail: [email protected]
CitySu team, Web Services Company
Antona Aškerca 44/50,
24000 Subotica
CitySu team
 
0

danield
Daniel Dulic
Web developer, CitySu team
Subotica

Član broj: 101580
Poruke: 113
*.co.yu
Via: [es] mailing liste

ICQ: 443682699
Sajt: www.citysuteam.com


Profil

icon Re: send mail preko php-a24.08.2006. u 23:14 - pre 215 meseci
Mislio sam da ne bude action="mailto:[email protected]?subject=komentar"
nego da bude action="salji.php"

--

With The Best Regards,

Daniel Dulić, Web System Development
http://www.citysuteam.com
Telefon: +381 (0) 64 / 364 - 65 - 91
E-Mail: [email protected]
CitySu team, Web Services Company
Antona Aškerca 44/50,
24000 Subotica
CitySu team
 
0

Pharos
Pančevo

Član broj: 20664
Poruke: 1029
*.3dnet.co.yu.



+2 Profil

icon Re: send mail preko php-a25.08.2006. u 00:28 - pre 215 meseci
Da li znaš kako u php-u POST metodom šalješ podatke nekoj stranici?
Ako znaš, zašto imaš
Code:
mailto:[email protected]?subject=komentar

Da li si pročitao kako radi mail f-ja u php-u.
Sve to da pročitaš ne treba ti više od 5 min.
77 77 77 2E 65 73 6E 69 70 73 2E 63 6F 6D
 
0

kelja

Član broj: 70429
Poruke: 1416
*.dialup.neobee.net.



+35 Profil

icon Re: send mail preko php-a25.08.2006. u 00:51 - pre 215 meseci
Ej,@pharos...momak je vrlo mlad...Koliko je tebi vremena trebalo da odradis prvu formu koja funkcionise?
Da zna ne bi pitao...
 
0

Pharos
Pančevo

Član broj: 20664
Poruke: 1029
*.3dnet.co.yu.



+2 Profil

icon Re: send mail preko php-a25.08.2006. u 00:59 - pre 215 meseci
Pa kad sam radio sa php-om, prvo što sam naučio je POST i GET metoda.
Ranije sam programirao u c++ pa mi varijable, funkcije i sl. nisu bile strane, mada to toliko nije bitno.
Neka napravi stranicu gde ima txt polje i jedno dugme i klikom na dugme da se otvori nova stranica gde će pisati Uneli ste:... pa sadržaj onog txt polja.
Neka pogleda mail f-ju i odradio je posao.

Ne cimam čoveka. Dao sam mu rešenje, samo neka se malo više potrudi.
Ako ne može s ovim da se snađe, onda mu je bolje da napusti programiranje.
77 77 77 2E 65 73 6E 69 70 73 2E 63 6F 6D
 
0

kelja

Član broj: 70429
Poruke: 1416
*.dialup.neobee.net.



+35 Profil

icon Re: send mail preko php-a25.08.2006. u 01:32 - pre 215 meseci
Ma kakvo napustanje;-)Ovo jesu banalne stvari,ali iz perspektive pocetnika(jos pogotovo ako nema veze sa programiranjem)ovo deluje ozbiljnije no sto zapravo jeste.
Vidi Daniele,
atribut 'name'ti je zapravo ime varijable.Ti ga prosledjujes php-u(u ovom slucaju fajlu 'salji.php')metodom post-posto zelimo da izbegnemo da nam mail bude meta spamera(izmedju ostalog).Probaj da stavis umesto 'post' metod 'get' i pogledaj sta se desava u address baru'browser-a...
E onda,da bi php 'pokupio' vrednosti varijabli moramo da uradimo sledece:u fajlu salji.php pisemo sledece
$imeiprezime=$_POST['imeiprezime'];
$email=$_POST['email'];
$komentar=$_POST['komentar'];
Onda definisemo varijable bitne za slanje maila:
$to="tvoj mail";
$subject="ovo je ,je li, tema";

$telo_poruke=" ............Kontakt forma................

Ime i prezime: $imeiprezime \n

E-mail: $email \n

Komentar: $komentar \n";

E sad dolazi na red mail funkcija koju je pharos pomenuo...Ona radi na sledeci nacin:

mail($to,$subject,$telo_poruke);

Imas tu mogucnost da dodas i zaglavlja(4.argument)ali to ti u ovom momentu nije bitno...Znaci ovo ti je neki najelementarniji mail skript.Ostavljam tebi da se pozabavis sa proverom unosa,ispisom poruke po uspesnom slanju mejla,ili pri gresci pri slanju,zastitom od spama(imas na netu gomilu gotovih primera-samo ih preradi i prilagodi svojim potrebama)
Pozdrav!




 
0

SmilieBG
Aleksandar Skodric
NL

Član broj: 13094
Poruke: 1821
*.speed.planet.nl.



+3 Profil

icon Re: send mail preko php-a25.08.2006. u 06:33 - pre 215 meseci
http://email.about.com/cs/phpemailtips/qt/et031202.htm

Google je majka, otac, brat, sestra, stric, ujak, i ostali deo blize i dalje rodbine...

Poz,
Sale
=========
Uporedi cene i karakteristike za vise od 10.000 proizvoda, izmedju ostalog:
Digitalni foto-aparati
Mobilni telefoni
Skolski pribor
=========
 
0

danield
Daniel Dulic
Web developer, CitySu team
Subotica

Član broj: 101580
Poruke: 113
*.co.yu
Via: [es] mailing liste

ICQ: 443682699
Sajt: www.citysuteam.com


Profil

icon Re: send mail preko php-a25.08.2006. u 07:47 - pre 215 meseci
imam 13godina

--

With The Best Regards,

Daniel Dulić, Web System Development
http://www.citysuteam.com
Telefon: +381 (0) 64 / 364 - 65 - 91
E-Mail: [email protected]
CitySu team, Web Services Company
Antona Aškerca 44/50,
24000 Subotica
CitySu team
 
0

Jezdimir Lončar
Aka Blazeme
PHP/jQuery Dev, BildStudio
Crna Gora / Pljevlja

Član broj: 74833
Poruke: 674
*.crnagora.net.

Jabber: jezdonet@gmail.com


+4 Profil

icon Re: send mail preko php-a25.08.2006. u 11:56 - pre 215 meseci
ja 12 :)
Anyway, evo napravio sam ti kontakt formu pa ti mjenjar radi sta hoćeš..
PHP: Mail()
“I never think of the future - it comes soon enough.” - Albert Anštajn (Albert Einstein)
Prikačeni fajlovi
 
0

cicevac.com
Saša Paunović
Ćićevac

Član broj: 62678
Poruke: 48
194.106.174.*

Sajt: www.cicevac.com


Profil

icon Re: send mail preko php-a26.08.2006. u 15:47 - pre 214 meseci
Evo i jedne zgodne skripte za proveru ispravnosti maila, moraćeš malo da je modifikuješ ali to je interesantan deo

Code:

<?php

// Add as many Names/ Departments -- e-mail addresses as you want here
$eMail[] = array( 'Information', '[email protected]' );
$eMail[] = array( 'Tech Support', '[email protected]' );

// CC sender?
$ccSender = True;

//  Handle older versions of PHP
if( ! isset( $_GET ) )  $_GET = &$HTTP_GET_VARS;
if( ! isset( $_POST ) )  $_POST = &$HTTP_POST_VARS;
if( ! isset( $_SERVER ) ) $_SERVER = &$HTTP_SERVER_VARS;

?>
<HTML>
<HEAD>
<TITLE>Mail Me!</TITLE>
<?php 
  if( ! isset( $_POST["EMail"] ) ) { 
?>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in [email protected], john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The username doesn't seem to be valid.");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("This address is missing a hostname!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}

function validate( form ){
var digits="0123456789"
var temp

if (form.To.value=="" ) {
  alert( "To Required!")
  return false
}
if (form.From.value=="") {
  alert("From Required!")
  return false
}
if( ! emailCheck(form.EMail.value) ) {
  return false
}
if (form.Subject.value=="") {
alert("Subject Required!")
return false
}
return true
}
// End -->
</SCRIPT>
<?php } ?>

</HEAD>
<BODY>

<?php if( ! isset( $_POST["EMail"] ) ) { ?>

<form method="POST" onsubmit="return validate(this)" name="MailForm"<?php echo ((isset($_SERVER['PHP_SELF']))?' action="' . $_SERVER['PHP_SELF'] . '"' : '')?>>

  <!--  Un-comment the following line if you want ALL fields in the form copied to the message body -->
  <!-- <input type=hidden name="AllFields" value="Yes">  -->

  <div align="center">
    <center>
    <table border="0" cellpadding="4" cellspacing="0">
      <tr>
        <td valign="top" align="right">To:</td>
        <td><select size="1" name="To">

<?php
  foreach( $eMail as $k => $a )
    if( (isset($_GET["To"])) && ( $_GET["To"] == $k) )
        echo "<option value=\"$k\" selected>$a[0]</option>\n";
    else
        echo "<option value=\"$k\">$a[0]</option>\n";
?>
          </select></td>
      </tr>
      <tr>
        <td valign="top" align="right">From:</td>
        <td><input type="text" name="From" size="44" maxlength="32"></td>
      </tr>
      <tr>
        <td valign="top" align="right">E-Mail:</td>
        <td><input type="text" name="EMail" size="44"></td>
      </tr>
      <tr>
        <td valign="top" align="right">Subject: </td>
        <td>
          <p align="center"><input type="text" name="Subject" size="44"></td>
      </tr>
    </table>
    </center>
  </div>
  <p align="center"><textarea name="Body" rows="10" cols="45"></textarea></p>
  <p align="center"><input type="submit" value="Send" name="Submit"></p><br><br>
  <center>This SPAM free script is available from <a href="http://www.arkie.net/~scripts/mailme/">Arkie.Net</a>
</form>

<?php
 } else { 

   echo "<B>Attempting to send message</b></BR></BR>\n";

   $userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
   
   //  Build message Body
   $body = "";
   if( isset( $_POST["AllFields"] ) ) {
     foreach( $_POST as $key => $value ) {
       if( $key == "To" ) {
         $body .= sprintf( "%s: \"%s\" <%s>\n\n", $key, $eMail[$value][0], $eMail[$value][1] );
       } else if( ( $key != "AllFields" ) && ($key != "Submit" ) ) {
         $body .= sprintf( "%s: %s\n\n", $key, $value );
       }
     }
   } else {
     $body = $_POST["Body"];
   }

   if( get_magic_quotes_gpc() == 1 ) {
     $_POST["Subject"] = stripslashes( $_POST["Subject"] );
     $body = stripslashes( $body );
   }

   //  Check for BCC injection...
   $checkInject = $_POST["From"] . "|" . $_POST["EMail"] . "|" . $_POST["Subject"] . "|" . $userip;
   if( preg_match( "/[\r\n]/", $checkInject ) ) {
     echo "Sorry! Spaming from this script is not allowed.";
     exit;  
   }

   // Send the message
   if( mail( '"' . $eMail[$_POST["To"]][0] . '" <' . $eMail[$_POST["To"]][1] . '>',
       $_POST["Subject"], $body,
       'Return-Path: "' . $_POST["From"] . '" <' . $_POST["EMail"] . ">\n"
       . 'From: "' . $_POST["From"] . '" <' . $_POST["EMail"] . ">\n"
       . 'Reply-To: "' . $_POST["From"] . '" <' . $_POST["EMail"] . ">\n"
       . (($ccSender)? 'Cc: "' . $_POST["From"] . '" <' . $_POST["EMail"] . ">\n" : "" )
       . "X-Mailer: PHP/" . phpversion() . "\n"
       . "X-From-IP: " . $userip ) )
     echo "Message Sent Successfully";
   else
     echo "UNABLE To Send Message.";
}
?>
  </BODY>
</HTML>

HardCore
 
0

ic2000

Član broj: 22817
Poruke: 106
*.crnagora.net.

Sajt: www.com-shop.co.uk


Profil

icon Re: send mail preko php-a04.05.2007. u 19:11 - pre 206 meseci
Pozdrav. Pitao bih Neohacker kako da kada kliknem posalji ne otvara prozor u kojemu pise da je poruka uspjesno poslata nego da se vrati na stranu sa kontakt formom.

Sorry ali ja sam tek totalni pocetnik

Hvala
 
0

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Moderator
Član broj: 32202
Poruke: 4391
77.46.235.*

Sajt: https://avramovic.info


+46 Profil

icon Re: send mail preko php-a05.05.2007. u 15:52 - pre 206 meseci
Pošalji header "location..."

Slanje headera:
http://php.net/header

(potraži na toj stranici "location")
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
0

ic2000

Član broj: 22817
Poruke: 106
*.crnagora.net.

Sajt: www.com-shop.co.uk


Profil

icon Re: send mail preko php-a05.05.2007. u 21:16 - pre 206 meseci
Pokusavam ali nikako ne ide. Los sam. Mozete li mi reci konkretno u ovoj skripti sto je postavio Neohacker gdje ide Header. Ja ne mogu da ga ubodem pa nema sanse :-(

Code:
<?php
/*
 * Kontakt forma
 * by Neo
 * (C) --=(Jezdo.net)=--
 */
// Ovde hvatam variable
$ime = $_REQUEST['ime']; // $_REQUEST se koristi da uhvatis variablu
$email = $_REQUEST['email'];
$komentar = $_REQUEST['komentar'];

// E ovde podesis sta ce sta da ti bude
$tvemail = "tvojmail@mail"; // Ovo je tvoj email
$subject = "..:: kontakt forma sa sajta ::.."; // Naslov
// Ispod nista ne diraj!

mail($tvemail,$subject,"
..:: Kontakt forma sa sajta ::..
Ime korisnika: ".$ime."
Email korisnika: ".$email."
Komentar korisnika:".$komentar."
--------------------------
By Neo") or die("<br />
Poruka nije poslata!!!<br />
"); 
echo "<font color='green'>Poruka je <b>uspješno poslata</b></font>";
?>


Hvala puno

[Ovu poruku je menjao Nemanja Avramović dana 06.05.2007. u 01:19 GMT+1]

[Ovu poruku je menjao ic2000 dana 06.05.2007. u 09:08 GMT+1]
 
0

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Moderator
Član broj: 32202
Poruke: 4391
77.46.235.*

Sajt: https://avramovic.info


+46 Profil

icon Re: send mail preko php-a06.05.2007. u 00:19 - pre 206 meseci
Kontaktiraj autora skripte ako želi i ima vremena da izmeni svoju skriptu. Ja bih ipak malo prostudirao header funkciju i pokušao sam da pronađem rešenje.
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
0

ic2000

Član broj: 22817
Poruke: 106
85.94.116.*

Sajt: www.com-shop.co.uk


Profil

icon Re: send mail preko php-a06.05.2007. u 17:30 - pre 206 meseci
Posto sam pocetnik a nikako mi ne ide molio bih nekoga da mi pomogne u vezi headera

Hvala
 
0

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Moderator
Član broj: 32202
Poruke: 4391
91.150.105.*

Sajt: https://avramovic.info


+46 Profil

icon Re: send mail preko php-a06.05.2007. u 18:05 - pre 206 meseci
Link ti je dat, a tebe samo mrzi da pročitaš sve što tamo piše. Isto tako i ljude ovde mrzi da besplatno rešavaju tuđe probleme. Imaš forum "IT Berza poslova" pa se obrati tamo ako želiš gotovo rešenje.
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
0

ic2000

Član broj: 22817
Poruke: 106
85.94.116.*

Sajt: www.com-shop.co.uk


Profil

icon Re: send mail preko php-a06.05.2007. u 19:21 - pre 206 meseci
molim te da mi ne pomazes

hvala
 
0

[es] :: PHP :: send mail preko php-a
(Zaključana tema (lock), by Nemanja Avramović)

[ Pregleda: 4436 | Odgovora: 16 ] > FB > Twit

Postavi temu

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.