phpmailer problem

Status
Not open for further replies.

jonathonbaker

New Member
Messages
5
Reaction score
0
Points
0
I've tried to run a test page in phpmailer, I have entered the SMTP address but get this error address;


Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/jbaker/public_html/class.smtp.php on line 105

Warning: fsockopen() [function.fsockopen]: unable to connect to mail.jonathonbaker.exofire.net :25 (Unknown error) in /home/jbaker/public_html/class.smtp.php on line 105
Message was not sent.Mailer error: Language string failed to load: connect_host

here's the test page;

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.jonathonbaker.exofire.net "; // SMTP server
$mail->From = "aslanandbeez@yahoo.co.uk";
$mail->AddAddress("aabwebdesign@gmail.com");

$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
echo 'Message has been sent.';
}
?>

what is it I am doing wrong? Do you need the files class.phpmailer.php and class.smtp.php
 

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
this is my code: Change it to fix your issue:

$to = "email@address";
$subject = "text";
$message = "body of \n text";
$from = "support@domain";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
 

jonathonbaker

New Member
Messages
5
Reaction score
0
Points
0
I did that and now I get this;


Parse error: parse error, unexpected T_CLASS in /home/www/jonathonbaker.com/emailtest.php on line 2
Edit:
oh yeah the code is now this;

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.jonathonbaker.exofire.net "; // SMTP server

$to = "aabwebdesign@gmail.com";
$subject = "text";
$message = "body of \n text";
$from = "aslanandbeez@yahoo.co.uk";
$headers = "From: $from";
mail($to,$subject,$message,$headers);

if(!$mail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
echo 'Message has been sent.';
}
?>
Edit:
Update;

sorry was looking at the wrong thing, I still get the same fsockopen() problem as before, this is frustrating since phpmailer has no support!
 
Last edited:
Status
Not open for further replies.
Top