求php里面自动发email给用户邮箱的相关代码 (100分送上 在线等) php里面用户填完表格后,自动发email给用户邮箱的相关代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 表单提交之后,你调用一下 mail函数,发送邮件就可以了。不过要保证你smtp服务器配置正确。 没有实际环境,我怎么给你写代码呢?其实很简单:比如:if ($_POST['submit']) //就是提交了表单{ .... //这里做你的一些事情,比如写入数据库之类的。 mail($to, $subject, $message, $headers); //调用mail函数,具体用法请参看手册吧} 和我一样啊!我昨天才看php,原来一直是作asp.net2.0,搞了一天了,郁闷死了,php和apache配置让人太郁闷!在线等 用PHPMAILER发吧。他的官方网站上面有例子。 这个可以用。我使用过的<?php// multiple recipients$to = '[email protected]' . ', '; // note the comma$to .= '[email protected]';// subject$subject = 'Birthday Reminders for August';// message$message = '<html><head> <title>Birthday Reminders for August</title></head><body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table></body></html>';// To send HTML mail, the Content-type header must be set$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";$headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";$headers .= 'Cc: [email protected]' . "\r\n";$headers .= 'Bcc: [email protected]' . "\r\n";// Mail itmail($to, $subject, $message, $headers);?> 楼上的不行,不能够很好的移植,通用性不强!经过一夜和一上午的奋战!!终于搞定!详情请看我的http://blog.csdn.net/lg836我正在编写中 求组php 控制播放器进度的问题 PHP如何控制表单某个文本框只读 php 上传视频的问题,在线等 SEO细节探讨:关键字 linux php小问题 大家能否帮下小弟再把这条asp语句转为php啊! onchange 的疑问,如何在下拉框改变时更新数据库??急急急急!!! 向高手请教一个使用session的问题! 一个关于PHP中Form的传递问题?! thinkphp分页和跳页 phpmailer 问题 用PHP怎么实现 动态画图 功能?
不过要保证你smtp服务器配置正确。
其实很简单:
比如:
if ($_POST['submit']) //就是提交了表单
{
.... //这里做你的一些事情,比如写入数据库之类的。
mail($to, $subject, $message, $headers); //调用mail函数,具体用法请参看手册吧}
在线等
<?php
// multiple recipients
$to = '[email protected]' . ', '; // note the comma
$to .= '[email protected]';// subject
$subject = 'Birthday Reminders for August';// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers
$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
$headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers .= 'Bcc: [email protected]' . "\r\n";// Mail it
mail($to, $subject, $message, $headers);
?>
经过一夜和一上午的奋战!!终于搞定!
详情请看我的http://blog.csdn.net/lg836
我正在编写中