Mail(Tujuan, Judul, Isi Mail, header, parameters);
Tujuan : alamat email penerimaJudul : judul email yang akan di kirim
Isi Mail : isi dari email
Header : header email
parameters : bersifat optional...
alamat pengirim dari email terletak pada header email... jadi disinilah unixnya... email pengirim bisa kita buat sesuka hati... ^_^ untuk lebih jelasnya perhatikan kode berikut...
<?php
if ($_POST["penerima"]<>'') {
$email_penerima = $_POST["penerima"];
$judul_email = $_POST["judul"];
$header_email = "From: ".$_POST["pengirim"]."\r\n";
$header_email .= "Reply-To: ".$_POST["pengirim"]."\r\n";
$header_email .= "Content-type: text/html; charset=iso-8859-1\r\n";
$isi_email = $_POST["pesan"];
mail($email_penerima, $judul_email, $isi_email, $header_email) or die ("Failure");
echo"Email berhasil dikirim ke $email_penerima";
?>
<?php
} else {
?>
<style type="text/css">
<!--
.style1 {
font-family: "Blackletter686 BT";
font-size: 80px;
}
-->
</style>
<form name="form1" method="post" action="send_mail.php">
<table width="80%" border="0">
<caption>
<span class="style1">Simple Send Mail By Ayrbyte</span>
</caption>
<tr>
<td>Alamat Email Pengirim</td>
<td><label for="pengirim"></label>
<input type="text" name="pengirim" id="pengirim"></td>
</tr>
<tr>
<td>Alamat Email Penerima</td>
<td><label for="penerima"></label>
<input type="text" name="penerima" id="penerima"></td>
</tr>
<tr>
<td>Judul Email</td>
<td><label for="judul"></label>
<input type="text" name="judul" id="judul"></td>
</tr>
<tr>
<td>Isi Email</td>
<td><label for="pesan"></label>
<textarea name="pesan" id="pesan" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td> </td>
<td><label for="SEND"></label>
<input type="submit" name="SEND" id="SEND" value="Kirim"></td>
</tr>
</table>
</form>
<?php
};
?>
simpan dengan nama send_mail.php kemudian upload ke web server anda... kemudian tinggal di coba deh... ^_^Download Source Code : https://www.facebook.com/download/202570533206657/Tutorial%20Kirim%20Email%20%28PHP%29.rarhttps://www.facebook.com/download/202570533206657/Tutorial%20Kirim%20Email%20%28PHP%29.rar
No comments:
Post a Comment