使用php发送电子邮件,但错误中继 [英] sending email using php but error relay

查看:54
本文介绍了使用php发送电子邮件,但错误中继的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码可以发送电子邮件:

 <   html  > ; 
<  正文 > 

<?  php  
 
 如果   (isset($ _ REQUEST ['电子邮件'])) 
 
 //如果   电子邮件"   span>          发送   电子邮件 
 
      { 
 
     回声   确定";  
 
     //发送   电子邮件 
 
      $ email     =   $ _ REQUEST ['   
 
      $ subject     =   $ _ REQUEST ['   
 
      $ message     =   $ _ REQUEST ['   
 
      mail("someone@example.com ",   "$ subject", 
 
      $ message    发件人:"      
 
       谢谢        使用   我们的    >邮件 表格";  
 
     }  
 
 其他 
 
 //如果   电子邮件"   span>          输出,   显示    the     form  
 
      {? > 
  <  表单    ='    =' > 
  电子邮件:<  输入   名称  =' 电子邮件' 类型 文本'   / >  <   br    > 
  主题:<  输入   名称  ='  subject' 类型 文本'   / >  <   br    > 
  消息:<   br    / > 
  <   textarea     ='    ='  15'    cols   ='  40' > 
  <  /textarea  >  <   br    > 
  <  输入    ='  submit' / <  /form  > 
  <?  php  
 
     }  
 
 ? > 

<  /body  > 
<  /html  >  




显示此错误消息,并且不发送电子邮件.

Warning: mail() [function.mail <http://localhost/function.mail>]: SMTP server response: 550 relay not permitted in  path 



请帮助.

解决方案

_REQUEST ['email']))) //如果 电子邮件" span> 发送 电子邮件 { 回声 确定"; //发送 电子邮件


电子邮件 =

_REQUEST [' 电子邮件']


I have this code to send email:

<html>
<body>

<?php

if (isset($_REQUEST['email']))

//if "email" is filled out, send email

  {

  echo "ok";

  //send email

  $email = $_REQUEST['email'] ;

  $subject = $_REQUEST['subject'] ;

  $message = $_REQUEST['message'] ;

  mail("someone@example.com", "$subject",

  $message, "From:" . $email);

   "Thank you for using our mail form";

  }

else

//if "email" is not filled out, display the form

  {?>
  <form method='post' action='webpage.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>
  <?php

  }

?>

</body>
</html>




this error message is displayed and email is not sent.

Warning: mail() [function.mail <http://localhost/function.mail>]: SMTP server response: 550 relay not permitted in  path 



please help.

解决方案

_REQUEST['email'])) //if "email" is filled out, send email { echo "ok"; //send email


email =


_REQUEST['email'] ;


这篇关于使用php发送电子邮件,但错误中继的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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