Home »
General »
PHP discussions »
Using PHP to send mail
Ynt: Re: Using PHP to send mail [message #186978 is a reply to message #166368] |
Thu, 08 October 2015 06:55 |
anilk123
Messages: 3 Registered: October 2015 Location: Turkey
Karma:
|
Junior Member |
|
|
Create and copy index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.yazilimdilleri.net</title>
</head>
<body>
<form action="mail.php" method="post">
İsminiz:<br/>
<input type="text" name="name"/><br/>
E-Posta adresiniz:<br/>
<input type="text" name="email"/><br/>
Konu:<br/>
<input type="text" name="subject"/><br/>
Mesajınız:</br>
<textarea name="message"></textarea><br/>
input type="submit" value="Gönder"/>
</form>
</body>
Createa and copy mail.php
if(isset($_[POST]['name']) && isset($_[POST]['email']) && isset($_[POST]['subject']) && isset($_[POST]['message']))
{
if(empty($_[POST]['name']) || empty($_[POST]['email']) || empty($_[POST]['subject']) || empty($_[POST]['message']))
{
echo "Lütfen formu tam doldurunuz";
}
else
{
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
$icerik = 'İsim: ' .$name. '<br/>E-Mail: ' .$email. '<br/>'. $mesaj;
mail('iletisim(at)batuhanavlayan(dot)com', $subject, $icerik);
//your@site . com yerine mail hangi adrese gidecek ise o adresi yazıyoruz.
echo "Mesajınız başarı ile gönderildi.";
}
}
else
{
echo 'Lütfen Formu Doldurun';
}
Its mee
|
|
|
Goto Forum:
Current Time: Thu Oct 31 23:07:56 GMT 2024
Total time taken to generate the page: 0.04321 seconds