Intermittent failure with Pear mail

I’m trying to send confirmation emails using Pear Mail.
The code I’m using seems to work - but only intermittently. I call the php file from within my browser and it fails. I hit F5 to refresh and then sometimes it works - sometimes it doesn’t.
It seems to be working 3 or 4 times out of 10.

When it fails I get this message…

Warning: mail() [function.mail]: SMTP server response: 451 #4.1.8 Domain of sender address <myemail@example.co.uk> does not resolve in C:\\PHP\\PEAR\\pear\\Mail\\mail.php on line 153

Does that make any sense to anyone ? and has anyone got any suggestions as to why this should be happening ?

Thanks…

<?php
// to remove the E_STRICT errors created by the PHP4 code in Mail
error_reporting(E_ALL);

include('Mail.php');
include('Mail/mime.php');

$text = "Text version of email\
Message made with PHP";
$html = '<html><body>HTML version of email<br />';
$html .= 'My Email <img src="12345" /></body></html>';
$crlf = "\
";
$hdrs = array(
              'From'    => 'admin@trythis.co.uk',
              'Subject' => 'Test HTMl Email with Embedded Image'
              );

$mime = new Mail_mime($crlf);
// set the text version of the email
$mime->setTXTBody($text);
// embed the image file
$mime->addHTMLImage('\\images\\flower.jpg', 'image/gif', '12345', true);
// set the HTML version of the email
$mime->setHTMLBody($html);

//do not ever try to call these lines in reverse order
$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail = Mail::factory('mail');
$succ = $mail->send('anyone@example.co.uk', $hdrs, $body);
// Check for sending errors
if (PEAR::isError($succ))
{
  echo 'Email sending failed: ' . $succ->getMessage();
}
else
{
  echo 'Email sent succesfully';
}
?>