Hi,everyone.I’m just signed up for this problem that I worked for past 2 days,and haven’t solved yet.
I have searched google and this fourm for many times,read many documents and topics,tried all the solutions they offered,but it still not work.
So,please,I need help.
Here is my problem:
My register page keep warning: "An error while sending the email. Please contact the Site Administrator." And the user was created,but the user can’t recieve the email with password.
I’ve tried to change the eform use SMTP follow below link:
http://modxcms.com/forums/index.php?topic=32969.0
Then the warning still showing.
I also read this link:
http://modxcms.com/forums/index.php?topic=35553.0
So I creat a php file in the root of www,code is:
<?php
$message = "Test 1\nTest 2\nTest 3";
mail(’
[email protected]’, ’Testing mail function’, $message);
?>
And when I visit the page in IE,it displayed nothing but a blank page,my email didn’t recieve anything either.
Many other ways I’ve tried yestaday and I can’t remember well.
My server is Linux and it seems have both sendmail and qmail running,by the way: I’m not very good at Linux.
Another website which is the same with the one I’m working on in the US is running well: register and feedback both can send mail.The US server installed InterWorx-CP,if I have to install that in this server too...
Now I have no idea with this problem,someone advise?
TKS!
P.S.: When I visit test.php which I created in the root of www with code below:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$address = $_POST[’address’];
$mail->IsMail();
//$mail->IsSMTP(); // set mailer to use SMTP
//$mail->Host = "xxx.xxx.xxx"; // specify main and backup server
//$mail->SMTPAuth = true; // turn on SMTP authentication
//$mail->Username = "
[email protected]"; // SMTP username
//$mail->Password = "xxx"; // SMTP password
$mail->From = "
[email protected]";
$mail->FromName = "test";
$mail->AddAddress("$address", "");
//$mail->AddAddress(""); // name is optional
//$mail->AddReplyTo("", "");
//$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
//$mail->IsHTML(true); // set email format to HTML
$mail->CharSet = "utf-8";
$mail->Subject = "PHPMailer测试邮件";
$mail->Body = "Hello,这是测试邮件";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
The IE warning:
Message could not be sent.
Mailer Error: Could not instantiate mail function.