Witam,
musze zrobić wysyłanie newsów ze stronki.
Czyli komus się podoba news i chce o tym powiadomić znajomego, klika na ikonke wpisuje e-mail adresata i podpis i wysyła.
Macie może coś prostego lub gotowego ?
<?php include_once('funkcje.php'); $polaczenie=polacz("baza"); if (!$polaczenie) { } $zapytanie=mssql_query("select * from Wiadomosci where id=".$_GET[id],$polaczenie); $wynik=mssql_fetch_assoc($zapytanie); { $do = $_POST['email']; $temat = 'Inormacja'; $tytul=$wynik['tytul']; $tresc=$wynik['tresc']; $email=$_POST['youremail']; $headers = 'From: poczta@testowo.pl' . "r\n" . 'Reply-To: poczta@testowo.pl' . "r\n" . } ?> <html> <script language="javascript" type="text/javascript"> function submitbutton() { var form = document.frontendForm; // do field validation if (form.email.value == "" || form.youremail.value == "") { alert( 'Wpisz poprawnie swój adres email oraz adres odbiorcy.' ); return false; } return true; } </script> <form action="mail.php?id=<?php echo $_GET['id']?>" method="post" name="frontendForm" onSubmit="return submitbutton();"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td colspan="2"> Wy¶lij znajomemu </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="130"> Adres e-mail znajomego: </td> <td> <input type="text" name="email" size="25" /> </td> </tr> <tr> <td height="27"> Twoje imię i nazwisko: </td> <td> <input type="text" name="yourname" size="25" /> </td> </tr> <tr> <td> Twój e-mail: </td> <td> <input type="text" name="youremail" size="25" /> </td> </tr> <tr> <td> Temat wiadomo¶ci: </td> <td> <input type="text" name="temat" maxlength="100" size="40" /> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> <input type="submit" name="submit" class="button" value="Wy¶lij e-mail" /> <input type="button" name="cancel" value="Anuluj" class="button" onclick="window.close();" /> </td> </tr> </table> <?php ?> <!--<input type="hidden" name="id" value="1554" /> <input type="hidden" name="8b2fcf7f298e6436ea8fb23430d4e418" value="1" />--> </form> </body> </html>
<?php // connect to MTA server 'smtp.gmail.com' port '465' via SSL ('tls' encryption) // with authentication: 'username@gmail.com' and 'password' // set the connection timeout to 10 seconds, the name of your // host 'localhost' and the authentication method to 'plain' // make sure you have OpenSSL module (extension) enable on your php configuration $c = $m->Connect('smtp.gmail.com', 465, 'username@gmail.com', 'password', // connect to MTA server 'smtp.gmail.com' port '465' via SSL ('tls' encryption) // with authentication: 'username@gmail.com' and 'password' // set the connection timeout to 10 seconds, the name of your // host 'localhost' and the authentication method to 'plain' // make sure you have OpenSSL module (extension) enable on your php configuration $c = $m->Connect('smtp.gmail.com', 465, 'username@gmail.com', 'password', ?>
<?php $c=Connect('smtp.mojadomena.pl', 25, 'poczta@mojadomena.pl', 'haslo', 10, 192.168.0.1, null) or die; ?>
<?php ?>