php邮件功能无法在Windows 7中运行

I have major problem with php mail() function.

Before my platform is windows xp. In my company we have a microsoft smtp server(I hope so). At this time the mail() function works perfectly. After some days i switched to windows 7 because of some reasons. This was where my problems begins. When i'm testing my old applications which ran very softly in xp, but not in windows7. Particularly mail() function is taking more execution time and keep on running like deadlock. After long back it displays below message

Fatal error: Maximum execution time of 30 secondsd exceeded in D:\wamp\www\ixe_bwf_apr03\writefile.php on line 265

the code in the line 265 is

$ok = mail($to, $subject, $message, $headers, $returnpath);

if i'm commented this line rest of the code is working nicely. Even i tried mail function alone but, same problem is trailing me. But the interesting thing is after the fatal error after some time i'm getting mail. Please someone help me to sort out this problem. Thanks in advance.

Add this to your htaccess file. You just need to extend your execution time of the scripts

    <IfModule mod_php5.c>

    php_value upload_max_filesize 200M
    php_value memory_limit 300M
    php_value max_execution_time 259200
    php_value max_input_time 259200
    php_value session.gc_maxlifetime 1200
    </IfModule>

There are many other ways to achieve this. You can also use ini_set() function

http://in1.php.net/manual/en/function.ini-set.php