文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>XAMPP: How to send email remotely

XAMPP: How to send email remotely

时间:2010-08-26  来源:creasy

To get your php script send the email using XAMPP. you need:

 

1. Modify your sendmail.ini inside the XAMPP_HOME\sendmail\sendmail.ini, you need to concern with 3 variables here:

  1. smtp_server
  2. auth_username
  3. auth_password

 

2. Modify your php.ini file inside XAMPP_HOME\php\php.ini, uncomment the statement:

  • sendmail_path = “C:\xampp\sendmail\sendmail.exe -t”

 

3. Use the Testing script to test:

   1:  <?php
   2:  $from_name = "taolin"
   3:  $from_email = "taolin@*.com";
   4:  $headers = "From: $from_name <$from_email>";
   5:  $body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
   6:  $subject = "Test mail from taolin"
   7:  $to = "somewhere@*.com";
   8:   
   9:  if (mail($to, $subject, $body, $headers)) {
  10:    echo "success!";
  11:  } else {
  12:    echo "fail…";
  13:  }
  14:  ?>
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载