没有收到电子邮件 [英] Not receiving eMail

查看:143
本文介绍了没有收到电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感到困惑的是什么问题,我没有收到任何电子邮件使用邮件php功能。

I'm confused with what the problem is, I'm not receiving any e-mail whilst using the mail php function.

<form action="mailer.php" method="post">
  <input type="text" name="named23" size="12">
  </td>
  </tr>
  <tr>
    <td colspan="2" nowrap valign="top">
      <input type="checkbox" name="CHK_NOCACHE" value="on">
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <div>
        <input type="submit" name="ch_but_logon" value="Entrer">
</form>

MAILER.PHP

MAILER.PHP

<?php
if (isset($_POST['ch_but_logon'])) {
    $txt = $_POST['named23'];   
    mail("psadsaxu@yahoo.sds","test",$txt);
}

?>


推荐答案

语法

Syntax

mail(to,subject,message,headers,parameters)

PHP简单电子邮件

PHP Simple E-Mail

<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>

PHP邮件表单

PHP Mail Form

<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("someone@example.com", $subject,
  $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text'><br>
  Subject: <input name='subject' type='text'><br>
  Message:<br>
  <textarea name='message' rows='15' cols='40'>
  </textarea><br>
  <input type='submit'>
  </form>";
  }
?>

</body>
</html>

这篇关于没有收到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆