CharSet = "utf-8"; //字符集 $mailToSend->Encoding = "base64"; //编码方式 $mailToSend->IsSMTP(); //使用SMTP方式发送 $mailToSend->Port = 25; //SMTP端口 $mailToSend->SMTPAuth = true; //启用SMTP验证功能 $mailToSend->Host = "smtp.163.com"; //您的企业邮局域名 $mailToSend->Username = "just_read_admin@163.com"; //邮箱用户名(请填写完整的email地址) $mailToSend->Password = "justread"; //邮局密码 $mailToSend->From = "just_read_admin@163.com"; //邮件发送者email地址,与上面的邮箱用户名相同 $mailToSend->FromName = "JustRead管理员"; //发出者称呼 $mailToSend->AddAddress("$address", "$name"); //收件人地址,可以替换成任何想要接收邮件的email信箱,格式是AddAddress("收件人email","收件人姓名") $mailToSend->IsHTML(true); //是否使用HTML格式 $mailToSend->Subject = $title; //邮件标题 $mailToSend->Body = $mailContent; //邮件内容 if(!$mailToSend->Send()){ return false; } else{ return true; } }