Rabu, 07 Mei 2014

Cara Mengirim E-Mail lewat Script

Assalamu'alaikum Wr. WB
Kali ini saya akan share bagaimana caranya mengirim email dengan script di hosting atau localhost .
1. Copykan script berikut di notepad
<html><head>
<title>Abyss Mail</title>
<link rel="shortcut icon" href="http://fanfanra.us.to/wp-content/themes/Orizon/Orizon/images/favicon.jpg" />
</head>
<body>
<style>
html {
background: url("http://fanfanra.us.to/wp-content/themes/Orizon/Orizon/css/blue_css/images/background_loop.jpg") repeat scroll left top transparent;
}
</style>
<center>
<b><font face=pristina color=white size=4>
<font face=pristina color=white size=6>Send Your Message to Someone<b><font face=calibri color=white size=4>
<br> </font>
<form action="<?php echo $PHP_SELF; ?>" method="POST">
<span style="color: white; font-family:Lucida calligraphy; font-size: x-small;"><b>Nama</b></span> <span style="color: red;"><small>*</small></span><br>
<input  name="nama" size="30" type="text" value="" />
<br>
<span style="color: white; font-family: Lucida calligraphy; font-size: x-small;"><b>To</b></span> <span style="color: red;"><small>*</small></span><br>
<input  name="to" size="30" type="text" value="" />
<br>
<span style="color: white; font-family: Lucida calligraphy; font-size: x-small;"><b>From</b></span> <span style="color: red;"><small>*</small></span><br>
<input  name="email" size="30" type="text" value="" />
<br>
<span style="color: white; font-family: Lucida calligraphy; font-size: x-small;"><b>Subjek</b></span> <span style="color: red;"><small>*</small></span><br>
<input  name="subject" size="30" type="text" value="" />
<br>
<span style="color: white; font-family: Lucida calligraphy; font-size: x-small;"><b>Pesan</b></span> <span style="color: red;"><small>*</small></span><br>
<textarea  cols="50"  name="message" rows="5"></textarea>
<br>
<input  type="submit" value="Kirim"/><input type="reset" value="Reset" />
</form>
<a style="color: white; id="cop_text" href="http://www.fanfanra.us.to/">Created by FanfanRA</a>
<center>
</body></html>
<?php
$to = $_REQUEST['to'];
$subject = $_REQUEST['subject'];
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$nama = $_REQUEST['nama'] ;
$headers = "From: $nama<$email>";
if(empty($email)||empty($subject)||empty($message)|| empty($headers))
{
print "<font Color='Chocolate'> <b> </b></font>";
}else
{
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{
print "<font Color='Chartreuse'>Email Anda telah terkirim <img src='http://dhost.info/afrizal/ceklist.jpg'>";
}
else
{print "Maaf Email tidak Dapat dikirim."; }
}
?>
2. jika sudah dicopykan klik " save as " namakan dengan email.html *beretak tebal berarti harus diikuti
3. cara membukanya yaitu.. klik kanan pada file ersebut ... pilih " open with >> Mozilla atau Chrome
4. Lihatlah apa yang terjadi
untuk demonya bisa dilihat disin Demo
atau bisa download file sourcenya disni
Nah itu dia.. bila tidaj jelas bisa tanya di kolom komentar
Sekian dari Saya.. Terima Kasih ..

Wassalamu'alaikum Wr. WB

Tidak ada komentar:

Posting Komentar