<?php
$check = checkdnsrr("yahoo.com", "ANY" );
if( $check)
{
print "Not available";
}
else
{
print "Available";
}
?>
I get an error message "Fatal error: Call to undefined function
checkdnsrr()"
is it that This function has been restricted on Xampp or am i doing
something wrong?
(2) Now i was trying to send a mail with Following Code
<?php
$headres ="From:My mail address\n";
$headers.="MIME-Version: 1.0\n";
$headers.="Content-type: text/plain;charset=ISO-8859-1\n";
if(Mail("to mail address i need to send ","Test Mail","Hello World",
$headres))
{print "Mail Successfully Send";
}
else
{
Print "Mail Not Send ";
}
?>
I have initialized Php ini file with Smtp address , Port.
Stopped and Started Php again and also booted my laptop again.
I get a warning
Warning: mail() [function.mail]: SMTP server response: 550 relaying
denied in F:\Softwares\Xampp\htdocs\sendmail2.php on line 5
Mail Not Send
After doing this i realized Sending mail with yahoo or gmail requires
me to send mail via smtp autentication and SSL
Now in the below mentioned script there are four mail.php files here ,
which one to use ? i have used mail.php file in PEAR as i am sending
mail using PEAR ,
But its not working.
<?php
require_once "..\php\PEAR\Mail.php";
$from = "<my mail address>";
$to = "<to whom ever i want to send mail>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "smtp.gmail.com";
$port = "465";
$username = "my user "name @gmail.com";
$password = "my password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
Though this script run's with out error but the page takes some to
load and then no messages are shown.
I dont understand what am i doing wrong.
if possible Let me know what am i doing wrong , and plese send me some
references or what to search for ?
Thank's in advance
baldaris
balda...@yahoo.com wrote:
> hi I am using Xamp ,
> (1) When i use this script
>
> <?php
>
> $check = checkdnsrr("yahoo.com", "ANY" );
> if( $check)
> {
> print "Not available";
> }
> else
> {
> print "Available";
> }
>
> ?>
>
> I get an error message "Fatal error: Call to undefined function
> checkdnsrr()"
>
> is it that This function has been restricted on Xampp or am i doing
> something wrong?
According to the documentation at http://be.php.net/checkdnsrr this
function is not implemented on Windows platforms. Try the PEAR class
Net_DNS.
Sorry, can't really help with those. The only SMTP mail class I ever
used was the PHPMailer class from Codeworx
(http://phpmailer.codeworxtech.com/) which worked pretty well for me
since I did not have PEAR support at my web server back than.
> Thank's in advance
> baldaris
- Jensen
--
Jensen Somers <http://jsomers.eu>
Email: -http:// +jensen@
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning."
- Rick Cook, The Wizardry Compiled
in the code you posted you set both $headres and $headers (mess).
Thank's for replying....Its actually a spelling mistage while writing.
Can you suggest me some Smtp server's and port by which i can send
mail's?
Thank's in advance
How about your host's? Or, if you're running this on your home system,
your ISP's?
People don't open their SMTP servers to just anyone - it just makes them
a spam relay.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================