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:
- smtp_server
- auth_username
- 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: ?>
相关阅读 更多 +
- 系统休眠文件删除后果 如何删除计算机的休眠文件 2025-04-22
- 站群服务器是什么意思 站群服务器的作用 站群服务器和普通服务器的区别 2025-04-22
- jQuery插件有何作用 jQuery插件的使用方法 2025-04-22
- jQuery插件有哪些种类 简单的jQuery插件实例 2025-04-22
-