Jump to content

Check if a mailserver is blacklisted


Re-JeeP

Recommended Posts

Hi!

I have a problem with a script that i'm creating to se if a mailserver is blacklisted.

[code]<?php
  $file = file_get_contents("http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29");
  print_r($file);
?>[/code]

I get this message
[quote="error mess"]Warning: file_get_contents(http://www.mail-abuse.com/cgi-bin/lookup?ip_address=81.228.8.29) [function.file-get-contents]: failed to open stream: HTTP request failed! in /www/bl/index.php on line 2[/quote]

Have I done something wrong or can't I solve my problem like this?

Thanks!

// Johan
Link to comment
https://forums.phpfreaks.com/topic/14598-check-if-a-mailserver-is-blacklisted/
Share on other sites

"HTTP request failed" most likely means it couldn't load the website. Besides - file_get_contents loads the contents into a string, not an array, so print_r wouldn't work (either use echo or print).

What problem are you trying to solve here? It doesn't take that long to look that info up.
[quote author=kenrbnsn link=topic=100579.msg397129#msg397129 date=1152896866]
Put a [code]<?php set_time_limit(0); ?>[/code] at the top of your script. This will prevent your script from timing out after 30 seconds.

It worked for me.[/quote]
Dosen't work. My PHP runs in safe-mode!
[quote author=kenrbnsn link=topic=100579.msg397143#msg397143 date=1152897627]
With the time limit set to 0 (infinate) the script worked fine.

Ken
[/quote]
Hi again!

I tried the script at home but did'nt get it to work all the time.

I clocked it and if it timed out it stopped at about 75 sec.

Same error mess...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.