高分求php发邮件例子

miclesvic 2003-07-18 01:58:05
现要做一个用php发送邮件的例子


哪位大哥可以帮忙
...全文
99 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
aliyiyi 2003-07-22
  • 打赏
  • 举报
回复
晕!!!
自己装一个啦!!!
我就自己装了一个,你可以下一个imail。
blueaurora 2003-07-22
  • 打赏
  • 举报
回复
我用的是PEAR中的mail和mail mime两个类
文档 (e文的)
http://pear.php.net/manual/en/package.mail.php
lxf_1976 2003-07-22
  • 打赏
  • 举报
回复
http://prdownloads.sourceforge.net/phpmailer/phpmailer-1.70.tar.gz?download

试试这个对你有没有帮助
Mistruster 2003-07-22
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2052/2052467.xml

---
MerakMailServer邮件服务器:
http://www.mistruster.com/soft/merak.zip
(破解:)
http://www.mistruster.com/soft/ORN_Merak.exe
dongjianguo 2003-07-21
  • 打赏
  • 举报
回复
怎样有邮件服务器呢?
xqi8 2003-07-20
  • 打赏
  • 举报
回复
Windows下怎么会不可以呢?要有个邮件服务器才行。
发邮件其实很简单,如果你看过邮件的源码,很容易就可以发了。
---
一般发邮件都是用mail()函数。
如:
mail($To,$Subject,$Body,"From:$from\nContent-Type: text/html;charset=\"gb2312\"");
$To是收件人,$Subject是标题,$Body是信体,$from是发件人;
Content-Type:是邮件部分的类型,charset="gb2312"字符集为国标。
Mistruster 2003-07-19
  • 打赏
  • 举报
回复
Windows下怎么会不可以呢?要有个邮件服务器才行。
发邮件其实很简单,如果你看过邮件的源码,很容易就可以发了。
---
一般发邮件都是用mail()函数。
如:
mail($To,$Subject,$Body,"From:$from\nContent-Type: text/html;charset=\"gb2312\"");
$To是收件人,$Subject是标题,$Body是信体,$from是发件人;
Content-Type:是邮件部分的类型,charset="gb2312"字符集为国标。
miclesvic 2003-07-19
  • 打赏
  • 举报
回复
楼上的兄弟可以加点注释吗??!!1
miclesvic 2003-07-18
  • 打赏
  • 举报
回复
在WINDOWS2000上有没有可以行的办法
blueaurora 2003-07-18
  • 打赏
  • 举报
回复
<?php
include('Mail.php');
include('Mail/mime.php');
$text = 'Text version of email';
$html = '<html><body>HTML version of email<br><img src="mm.jpg"></body></html>';
$file = 'c:/php/news.txt';
$crlf = "\r\n";
$hdrs = array(
'From' => 'test@host',
'TO' => 'to@host',
'Subject' => 'Test mime message'
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addHTMLImage('i:\mm.jpg');
$mime->addAttachment($file, 'text/plain');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
/*
smtp
$param["host"] - The server to connect. Default is localhost
$param["port"] - The port to connect. Default is 25
$param["auth"] - Whether or not to use SMTP authentication. Default is false
$param["username"] - The username to use for SMTP authentication.
$param["password"] - The password to use for SMTP authentication.
*/

$param = array(
'host' => 'host',
'port' => 25,
'auth' => false,
'username' => 'user',
'password' => 'pass'
);

$mail =& Mail::factory('smtp', $param);
$s = $mail->send('to@host', $hdrs, $body);
if (PEAR::isError($s)){
echo $s->getMessage();
} else {
echo 'success!';
}

?>
myblessu 2003-07-18
  • 打赏
  • 举报
回复
同意楼上的,但这方法在windows上行不通.
as002 2003-07-18
  • 打赏
  • 举报
回复
mail函数就可以发


mail
寄出电子邮件。

语法: boolean mail(string to, string subject, string message, string [additional_headers]);

传回值: 布林值

函式种类: 网路系统




内容说明


本函式寄出电子邮件到指定的邮件地址 to,subject 表示主题,message 为信件内容。额外的选项 additional_headers 可省略,表示其它的邮件档头。




使用范例


<?
$message="abcdefghijklmnopqrstuvwxyz";
mail("php@wilson.gs", "没有主题", $message, "From: someone@wahaha.org.tw\nReply-To: reply@wahaha.org.tw\nX-Mailer: PHP/" . phpversion());
?>




--------------------------------------------------------------------------------







21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧