查看完整版本: [-- php能否配置exchange --]

Exchange技术论坛 -> Exchange Server 2010 -> php能否配置exchange [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

mch95 2017-09-12 09:59

php能否配置exchange

请教大神,该怎么配置,要做哪些准备

flowerwaiter 2017-09-14 10:48
你说的配置是啥意思,发邮件给exchange么?
PHP中配置SMTP的代码示例如下:
";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
$smtp = Mail::factory('smtp',
   array ('host' => $host,
     'auth' => true,
     'username' => $username,
     'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
   echo("

" . $mail->getMessage() . "

");  } else {   echo("
Message successfully sent!

");  } ?>


查看完整版本: [-- php能否配置exchange --] [-- top --]



Powered by phpwind v8.7.1 Code ©2003-2011 phpwind
Time 0.014249 second(s),query:6 Gzip enabled