无法发送消息 [英] Can't send message

查看:125
本文介绍了无法发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个页面上填写表格,然后尝试发送

电子邮件并在下一页打印出vars。


Q1:每当我插入邮件脚本时,它都会给我一个解析错误。

请指出我的语法错误等。


解析错误:解析错误,在第2行的/mathathhere/proposalconfirm.php中期待'T_STRING''或'T_VARIABLE''或

`T_NUM_STRING''


--script in问题

<? session_start();

$ msg =" xx建议:\ n \\\ $ _POST [''cpname''],\ t $ _POST [''cptitle''] \\ \\ n" ;;

$ msg。=" \t $ _POST [''cpcomp''] \ n" ;;

$ msg。=" \\ \\ t地址:\ t $ _POST [''cpaddress''] \ n" ;;

$ msg。=" \t $ _POST [''cpcity''],$ _POST [ ''cpstate''] \t $ _POST [''cpzip''] \ n" ;;

$ mailheaders ="来自:公司名称here \ n" ;;

$ mailheaders =" CC:$ _POST [''cpemail'']" ;;

mail(" me@my.com"," xx Custom Proposal",$ msg,$ mailheaders);

?>

< html>

- 脚本 -


所有vars的打印工作正常(一旦我从post var标注中删除双

引号)


Q2:我是需要会话来跟踪从页面到页面的表单变量

或我添加不必要的compl这是什么?


我上一次大型PHP开发工作大约是2年前。从那以后,

快速和脏的flatfile数据库连接(成员列表)

都是我不得不面对的。在那段时间里,PHP和MySQL确实改变了原因。

提前感谢您的帮助。

I''m filling out forms on one page, then trying to send an
email and print out the vars on the next page.

Q1: Whenever I insert the mail script, it gives me a parse error.
Please point out my syntax errors, etc.

Parse error: parse error, expecting `T_STRING'' or `T_VARIABLE'' or
`T_NUM_STRING'' in /mypathhere/proposalconfirm.php on line 2

--script in question
<? session_start();
$msg = "x x proposal for:\n\t$_POST[''cpname''],\t$_POST[''cptitle'']\n";
$msg .= "\t$_POST[''cpcomp'']\n";
$msg .= "\tAddress:\t$_POST[''cpaddress'']\n";
$msg .= "\t$_POST[''cpcity''], $_POST[''cpstate'']\t$_POST[''cpzip'']\n";
$mailheaders = "From: company name here\n";
$mailheaders = "CC: $_POST[''cpemail'']";
mail("me@my.com","x x Custom Proposal",$msg,$mailheaders);
?>
<html>
--rest of script--

The printing of all vars works fine (once I removed the double
quotes from the post var callouts)

Q2: Do I need sessions to track the form vars from page to page
or am I adding unnecessary complexity to this?

My last large PHP dev work was about 2 years ago. Since then,
quick and dirty flatfile database connections (member lists)
are all I''ve had to contend with. Things have really changed
with PHP and MySQL in that time.

Thanks in advance for the help.

推荐答案

msg =" xx提案:\ n \t
msg = "x x proposal for:\n\t


_POST [''cpname''],\ t
_POST[''cpname''],\t


_POST [''cptitle''] \ n" ;;
_POST[''cptitle'']\n";


这篇关于无法发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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