|
查看: 1235|回复: 4
|
PHP MAIL
[复制链接]
|
|
|
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\EasyPHP 2.0b1\www\eleave\leave_pending.php on line 62
当我要用php send mail的时候,出现上面的问题,要怎么改?
我是用这个code来send的
<?php
$to = "xxx@hotmail.com";
$from = "aaa@gmail.com";
$from_header = "From: $from";
$subject = "Test E-Mail (This is the subject of the E-Mail)";
$c;
if(mail($to, $subject, $contents, $from_header))
{
echo "The email($subject) was successfully sent.";
}
else {
echo "The email($subject) was NOT sent.";
}
?>
[ 本帖最后由 star4u 于 27-9-2008 09:55 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 27-9-2008 12:20 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 27-9-2008 06:58 PM
|
显示全部楼层
原帖由 star4u 于 27-9-2008 09:34 AM 发表 
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\EasyPHP 2.0b1\www\el ...
到你的 php.ini 中找出你的 mail function, 然後把下方 SMTP 的 localhost 該成你 ISP 所提供的 SMTP 網址及 sendmail_from 改成你的 email 帳號 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 28-9-2008 10:28 AM
|
显示全部楼层
[mail function]
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
;sendmail_from = xxx@gmail.com
Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\EasyPHP 2.0b1\www\eleave\leave_pending.php on line 60
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\EasyPHP 2.0b1\www\eleave\leave_pending.php on line 61
我放错了吗?
[ 本帖最后由 star4u 于 28-9-2008 10:39 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 30-9-2008 10:29 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|