これは私のコードです:
<?php
if ( isset($_POST['send']) ) {
$name = $_POST['name'];
$to = 'kiarash@gmail.com';
$subject = 'Test Sending';
$message = 'This is Test for sending Mail';
$header = 'Content-type: text/plain; charset="utf-8"' . "\r\n" .
'From: test@site.ir' . "\r\n" .
'Replt-To: test@site.ir' . "\r\n";
$mailsent = mail($to, $subject, $message, $header);
echo "this is mail sent---> " . $mailsent;
}
?>
およびこの HTML コード:
<form action="#" method="post" name="frm">
<input type="text" name="name" />
<input type="submit" value="send" name="send" />
</form>
ホストは Parallel Plesk を使用していますが、メールが送信されませんでした...
私の問題は何ですか?私へのアイデアや提案はありますか?
これは完全なコードです:
<!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" />
<title>Untitled Document</title>
</head>
<body>
<?php
if ( isset($_POST['send']) ) {
$name = $_POST['name'];
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
$to = 'kiarash@gmail.com';
$subject = 'Test Sending';
$message = 'This is Test for sending Mail';
$header = 'Content-type: text/plain; charset="utf-8"' . "\r\n" .
'From: info@site.ir' . "\r\n" .
'Reply-To: info@site.ir' . "\r\n";
$mailsent = mail($to, $subject, $message, $header);
if($mailsent){
echo "success";
}else{
echo "not sent";
}
}
?>
<form action="#" method="post" name="frm">
<input type="text" name="name" />
<input type="submit" value="send" name="send" />
</form>
</body>
</html>