PDA

View Full Version : ارسال ایمیل به ایمیل اصلی



jariyan
دوشنبه 27 تیر 1390, 03:00 صبح
با درود
من برنامه QK SMTP Server 3 نصب کردم
و این تنظیمات رو هم انجام دادم




[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

SMTP = mail.earthlink.net
sendmail_from = youraddress@yourdomain.com
sendmail_path = /opt/sendmail -odd arguments








و این دو صفحه هم درست کردم



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>E-Mail Form</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<body>
<form action="sendmail.php" method="POST">
<p><strong>Name:</strong><br> <input type="text" size="25" name="name" /></p>
<p><strong>E-Mail Address:</strong><br />
<input type="text" size="25" name="email" /></p>
<p><strong>Message:</strong><br />
<textarea name="message" cols="30" rows="5"></textarea></p>
<p><input type="submit" value="send" /></p>
</form>
</body>
</html>



و




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
<head>
<title>Sending mail from the form in Listing 11.10</title>
</head>
<body>
<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>".$_POST["email"]."</b>.</p>";
echo "<p>Your message was:<br />";
echo $_POST["message"]."</p>";
//start building the mail string
$msg = "Name: ".$_POST["name"]."\n";
$msg .= "E-Mail: ".$_POST["email"]."\n";
$msg .= "Message: ".$_POST["message"]."\n";
//set up the mail
$recipient = "you@yourdomain.com";
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \n";
$mailheaders .= "Reply-To: ".$_POST["email"];
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>





,وقتی ایمیل ارسال می کنم برنامه می گه ارسال شده ولی به آدرس اصلی مثلا jariyan@yahoo.com ارسال نشده مشکل از کجاست
باید چه کدی بنویسم که به ایمیل اصلی هم ارسال بشه.