Results 1 to 10 of 13
-
19-07-2012, 11:01 AM #1Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 36
- Mentioned
- 0 Post(s)
Coding PHP untuk hantar email apabila tekan Submit/Hantar
salam.... ada tak sapa2 yg penah buat coding untuk php bila kita isi form dan tekan butang simpan/hantar/submit data dalam form tu akan simpan dalam database, so untuk admin tahu bahawa ada org isi form tu satu email akan sampai kat admin... faham x ayat??? bila tekan butang simpan/submit satu email akan dihantar kepada admin bahawa ada org mengisi form tu.... harap paham la deh... ingin bantuan dari korang semua...
Latest Entries
- [Pertanyaan] Perisian yang Membangunkan Laman Web Berasaskan...
- [Pertanyaan] Google Adsense
- [pertanyaan] Bagaimana nak run 'include php' secara offline guna...
- Design Laman Web Kereta
- Jom Bina Web Di Web Hosting PERCUMA Hostinger.MY Dan Dapatkan...
- [Pertanyaan] Cara Membina Borang di dalam Sistem..??
- [Pertanyaan] Cara Upload file ke Dreamweaver & database...
- [Pertanyaan] Cara Membina Admin Panel
- application web yang terbaik termudah yg free...hahaha
- [Pertanyaan] Mencari Tutorial
-
19-07-2012 11:01 AM # ADS
-
19-07-2012, 01:26 PM #2Status
- Offline
-
Gempak Newbie
- Join Date
- Feb 2010
- Posts
- 7
- Mentioned
- 0 Post(s)
sy penah gune phpmailer utk send email(utk PHP je tau).email bole cc ke email admin..mgkin bole tgk tutorial die n download class die..simple n mudah bg sy..hehe
-
19-07-2012, 02:13 PM #3Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 5
- Mentioned
- 0 Post(s)
contoh mudah:
if($_POST) {
$name = $_POST[name];
$from_email = $_POST[email];
$to_email = 'admin@example.com';
$subject = 'Someone has filled the form';
$message = 'Someone has filled the form from your website';
$headers = "From:$name<$from_email>";
mail($to_email,$subject,$message,$headers);
}
-
19-07-2012, 03:33 PM #4Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 36
- Mentioned
- 0 Post(s)
-
19-07-2012, 03:33 PM #5Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 36
- Mentioned
- 0 Post(s)
-
19-07-2012, 04:00 PM #6Status
- Offline
-
Gempak Newbie
- Join Date
- Feb 2010
- Posts
- 7
- Mentioned
- 0 Post(s)
include ("email/class.phpmailer.php");
try {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = "smtp";
$mail->Host = "ssl://smtp.gmail.com";<--contoh klu gne gmail
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "user@gmail.com";
$mail->Password = "pwd";<--pwd email
$mail->From = "email_from@gmail.com";
$mail->FromName = "name";
$mail->AddAddress(email, nama);<--set email n nama penerima
$mail->AddCC("admin@gmail.com","description");<-- cc to email admin
$mail->WordWrap = 100;
$mail->IsHTML(true);
$mail->Subject = "Title email";
$mail->Body = "content email.";
$mail->AddAttachment("attachment_file");<-- bole gune function if nk attach doc
if($mail->Send())
{
echo mainpage;
}
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
class utk phpmailer tu kene donlod la ye..hopefully ade idea la nk wat cane..
-
19-07-2012, 04:47 PM #7Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 36
- Mentioned
- 0 Post(s)
-
19-07-2012, 07:00 PM #8Status
- Offline
-
Gempak Newbie
- Join Date
- Jan 2012
- Posts
- 5
- Mentioned
- 0 Post(s)
Last edited by duelist; 20-07-2012 at 08:51 AM.
-
20-07-2012, 10:29 AM #9Status
- Offline
-
Gempak Newbie
- Join Date
- Aug 2010
- Posts
- 1
- Mentioned
- 0 Post(s)
Assalamualaikum..saya nak membantu..juz nk confirmkan balik situasi..satu form yang diisi oleh user kemudian disimpan didalam database..dalam masa yang sama, sistem akan hantar satu email kpd admin mengatakan ada form yang baru diisi..guna coding php,kan? duduk area mana? klau bleh bg coding form kat email saya, saya boleh alterkan..
-
20-07-2012, 11:18 AM #10
cmni k? aq test2 j..

<?php $MAiLcommt ?>
<form>
<input type='submit' class='btn' name='Send_Form' value='Submit'>
</form>
//setting email if $SendEnqkMAiL berjaye
<?php
function SendEnqkMAiL($SendBy,$info) {
$SendMaiLTO = "foooo@gmail.com";
$Subject = "submit fooo";
$message = preg_replace("/<br[[:space:]]*\/?[[:space:]]*>/i","\n",$info);
$Header = "From: $systemMAIL" . "\r\n"
. "Reply-To: $SendBy" . "\r\n"
. "Return-Path: $SendBy" . "\r\n"
. "Content-type: text/plain; charset=ISO-8859-1" . "\r\n";
mail($SendMaiLTO,$Subject,$message,$Header);
}
//check input data dari form
if (isset($_POST['Send_Form']))
{
$customer = (isset($_POST['customer'])) ? $_POST['customer'] : NULL;
$custmail = (isset($_POST['custmail'])) ? $_POST['custmail'] : NULL;
$FeedMSG = "Someone have submit form"."\n". "Sender: " . $customer . "\n" .
"Reply-To: " . $custmail . "\n"
;
if ($customer=="" && $custmail=="" ) {
$MAiLerror = 1;
$MAiLcommt .= "<div> You did not enter the required fields</div>";
}
else {
SendEnqkMAiL($custmail,$FeedMSG);
$MAiLcommt = "<div">Thank you!</div>";
}
?>
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



LinkBack URL
About LinkBacks
Quote







Satu lagi masalah