Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > PHP > php 的mail() 的问题
【标  题】:php 的mail() 的问题
【关键字】:php,mail
【来  源】:http://www.cublog.cn/u/6221/showart.php?id=96832

php 的mail() 的问题

Your Ad Here
想用在我租用的万网的空间上用mail()函数发送表单邮件

用<?php phpinfo() ?> 看到这个服务器空间上的sendmail_from 是 me@localhost.com

mail()函数的使用格式是: mail(收件人Email, 信件標題, 信件內容, 信件檔頭, 其他參數)

那在"收件人Eamil"的上,我应该填写 me@localhost.com ?

但我想用来接收表单邮件的mail是: 163@163.com ,应该怎么办?又不能到服务器上改php.ini 中的 sendmail_from 的设置为163@163.com。

给你贴一个例子吧,发件人写在header信息里面

/* recipients */
$to = "Mary <mary@example.com>" . ", " ; // note the comma
$to .= "Kelly <kelly@example.com>";

/* 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, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";

$headers .= "Cc: birthdayarchive@example.com\r\n";
$headers .= "Bcc: birthdaycheck@example.com\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers);
以开源精神看Php和Jsp/Java:【上一篇】
一个简陋的,破烂的,自家产的文本数据库系统:【下一篇】
【相关文章】
  • 以开源精神看Php和Jsp/Java
  • http2+PHP5 + MySQL5 + GD2 + Proftpd + php
  • Linux webmail 终于安装成功
  • Setting up a PHP 5 with Apache 2 and MySQL 4.1.3
  • 发放Gmail和msn8.0 beta的邀请,需要的来
  • 用Email免费发送传真
  • google talk + google mail
  • foxmail6你用过了吗?
  • flash与php交互学习笔记 <<续>>flash+php+mysql
  • [转载]谈PHP生成静态页面 模板+缓存+写文件
  • 【随机文章】
  • C#中的cookie编程
  • this super 在java里使用时应注意的地方
  • ISA 术语大全(7)R-S
  • Outlook Add-In,安全带来的麻烦
  • ASP中一个用VBScript写的随机数类
  • C#锐利体验(4.1)
  • Ajax Q&A(Ajax“发明人”答问)
  • DocBook学习(v1.6.7)
  • 因为那魔鬼看着顺眼
  • ReportBuilder Enterprise v7.03 For D7 零售版
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.