Home > Backend Development > PHP Tutorial > PHP发送邮件

PHP发送邮件

WBOY
Release: 2016-06-23 14:32:48
Original
1051 people have browsed it

简介:这是PHP发送邮件的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=329773' scrolling='no'>

必须先对php.ini 进行配置

将extension=php_imap.dll前面的“;”去掉

http://php.net/manual/en/function.imap-mail-compose.php

imap_mail_compose 根据给定的信封和正文部分创建一个MIME消息。

string imap_mail_compose ( array $envelope , array $body )

envelop body都是数组。

<?php $envelope["from"]= "joe@example.com";$envelope["to"]  = "foo@example.com";$envelope["cc"]  = "bar@example.com";$part1["type"] = TYPEMULTIPART;$part1["subtype"] = "mixed";$filename = "/tmp/imap.c.gz";$fp = fopen($filename, "r");$contents = fread($fp, filesize($filename));fclose($fp);$part2["type"] = TYPEAPPLICATION;$part2["encoding"] = ENCBINARY;$part2["subtype"] = "octet-stream";$part2["description"] = basename($filename);$part2["contents.data"] = $contents;$part3["type"] = TYPETEXT;$part3["subtype"] = "plain";$part3["description"] = "description3";$part3["contents.data"] = "contents.data3\n\n\n\t";$body[1] = $part1;$body[2] = $part2;$body[3] = $part3;echo nl2br(imap_mail_compose($envelope, $body));?>
Copy after login

“PHP发送邮件”的更多相关文章 》

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/329773.html pageNo:12
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template