Jump to content
php.lv forumi

email sutishanas skripts


tester

Recommended Posts

sveiki, man majas ir savs serveris jaunakais apache -2.2.x (precizi no galvas neaceros versijas nr) jaunakais php 5 vis pec manam domam nokonfigurets pareizi gan php gan apache uztadijumos vis strada ka vajg iznjemot mail sutishanas skiptu... saulaik biju uzraxtijis mail sutishanas skriptu ar formu kuru biju domajis izmantot sava web lapa uzliekot uz servera un testejot nez kape nenosutijas mails kludu nevareju atrast un ta saku testet - izmantoju php net piejamo paraugu -

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
 <title>Birthday Reminders for August</title>
</head>
<body>
 <p>Here are the birthdays upcoming in August!</p>
 <table>
<tr>
  <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
  <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
  <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
 </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>

ar shadu kodu mails nosutat bet tik lidz lieku shini pasakuma ieksha formu nekas neizdoad ... piem uzraku te vienu paraudzinju kurma ari pec mana mdomama vajadzetu stradat bet nez kape tas nestrada -

index.html

<body>
<form method="post" action="mail.php">
 <textarea name="uzmailu"></textarea>
 <br />
 <input name="submit" type="submit" value="sūtīt" />
</form>
</body>
</html>

mail.php

<?php
if (!empty($_POST['uzmailu']) && trim($_POST['uzmailu']))
mail('mans_pasts@inbox.lv', 'Subject lauks, jauns komentars',$_POST['uzmailu']); 
?>

ps. nesu ipashi zinosh shaja lieta tapec ludzu jusu padomu kas pa vainu un ko daru nepareizi ? paldies jau ieprieks !

Link to comment
Share on other sites

HEEELP, esmu akls - nemāku atrast ADD REPLY pogu

 

uz win , smtp konfiguracija pec manam domam ir pareiza - ne nu varbut vari iedot kadu piemeru ka ta butu jaraxta pareizi ? mosh tur man kas skibi aizgajis ? bet tada gadijuma ja tur kluda konfiguracija kapec viena varianta suta mailu un otraa nee ?

Link to comment
Share on other sites

HEEELP, esmu akls - nemāku atrast ADD REPLY pogu

 

kludas neizvada ..

 

php.ini

[mail function]

; For Win32 only.

SMTP = mail.tk.lv < mana provaidera mail serveris

smtp_port = 25

 

; For Win32 only.

;sendmail_from = home.tk.lv < mana provaidera mail serveris

 

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").

;sendmail_path =

 

; Force the addition of the specified parameters to be passed as extra parameters

; to the sendmail binary. These parameters will always replace the value of

; the 5th parameter to mail(), even in safe mode.

;mail.force_extra_parameters =

Edited by bubu
Link to comment
Share on other sites

×
×
  • Create New...