php发送网页邮件的格式(服务器是unix)
因为服务器事unix的所以用mail函数就可以发邮件,我现在要作的就是像中华英才一样给客户发送简历带有格式那种~~~~
------解决方案--------------------
什么动态呢,你是指那个message那里面的信息是动态的吗,这个很容易啊!
你这里插入一些php的表单变量(用户端输入的表单数据),不就可以了吗
------解决方案--------------------
看phpmail类的例子
------解决方案--------------------
设定邮件的头信息中的content-type
content-type: text/html; charset=你自己的编码
从mail的第4个参数设定。
lz参考一下文档,有例子
http://jp.php.net/manual/en/function.mail.php
------解决方案--------------------
debug = false;
$this->smtp_port = $smtp_port;
$this->relay_host = $relay_host;
$this->time_out = 30; //is used in fsockopen()
#
$this->auth = $auth;//auth
$this->user = $user;
$this->pass = $pass;
#
$this->host_name = localhost; //is used in helo command
$this->log_file = error.txt;
$this->sock = false;
}
/* main function */
function sendmail($to, $from, $subject , $body, $mailtype, $cc = , $bcc = , $additional_headers = )
{
$mail_from = $this->get_address($this->strip_comment($from));
$body = ereg_replace((^|(\r\n))(\.), \1.\3, $body);
$header= mime-version:1.0\r\n;
if($mailtype==html)
{
$header .= content-type:text/html;charset=utf-8\r\n;
//$header .= content-transfer-encoding: base64\n\n;
}
$header .= to: .$to.\r\n;
if ($cc != )
{
$header .= cc: .$cc.\r\n;
}
$header .= from: $from\r\n;
$header .= subject: .$subject.\r\n;
$header .= $additional_headers;
$header .= date: .date(r).\r\n;
$header .= x-mailer:by redhat (php/.phpversion().)\r\n;
list($msec, $sec) = explode( , microtime());
$to = explode(,, $this->strip_comment($to));
if ($cc != )
{
$to = array_merge($to, explode(,, $this->strip_comment($cc)));
}
if ($bcc != )
{
$to = array_merge($to, explode(,, $this->strip_comment($bcc)));
}
$this->headers = $header;
$sent = true;
foreach ($to as $rcpt_to)
{
$rcpt_to = $this->get_address($rcpt_to);
if (!$this->smtp_sockopen($rcpt_to))
{
$this->log_write(error: cannot send email to .$rcpt_to.\n);
$sent = false;
continue;
}
if ($this->smtp_send($this->host_name, $mail_from, $rcpt_to, $header, $body))
