This topic is locked
[SOLVED]

 Runner_Mail Can't Sent Mail

3/4/2013 12:12:39 AM
PHPRunner General questions
J
jackolantern author

why runner_mail can't sent the email. No error message occur in trapping error, but email not sent.

Below is the code i put in event BeforeRemindPassword in password reminder page.



global $conn;

$found=0;

if ($username<>'')

{

$strSQLExists = "SELECT fullname, username, password, email FROM users

WHERE

username='$username'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

$email=$data["email"];

$fullname=$data["fullname"];

$password=$data["password"];

$subject="Password Shipments";

$found=1;

}

}else{

$strSQLExists = "SELECT fullname, username, password, email FROM users

WHERE

email='$email'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

$username=$data["username"];

$fullname=$data["fullname"];

$password=$data["password"];

$subject="Password Shipments";

$found=1;

}

}
if ($found==1)

{

$body="Dear Mr/Mrs/Ms $fullname,

This password has been sent from

<a href=http://test.co.id/shipments>http://w3.test.co.id/shipments</a>;
This your user account information:
Username=$username
Password=$password
To change password please login, and choose menu [Change password].
If you forget your username or password you can access Password Remainder, in [Forgot Password?] menu in login page.


This email is generated by system.

";

$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'htmlbody' => $body, 'charset' => 'UTF-8'));

$headers = "From: fajar_i@baramultigroup.co.id";

//mail($to, $subject, $body, $headers);



// if error happened print a message on the web page

if(!$ret["mailed"])

{

echo "Error happened:
";

echo "File: " . $arr["errors"][0]["file"] . "
";

echo "Line: " . $arr["errors"][0]["line"] . "
";

echo "Description: " . $arr["errors"][0]["description"] . "
";

echo $ret["message"]. "
";

}

}else{

echo "Username or Email not registered";

}
return false;
Sergey Kornilov admin 3/4/2013

As a first step you need to make sure you specified correct mail server parameters in PHPRunner under Security->User Login settings. Then test it trying to send a simple email from one of events. Once simple email works you can add more complicated event code.

J
jackolantern author 3/4/2013



As a first step you need to make sure you specified correct mail server parameters in PHPRunner under Security->User Login settings. Then test it trying to send a simple email from one of events. Once simple email works you can add more complicated event code.


I dunno it's just me or not, even simple sent mail if am use Built-In mailer it's not working.

After frustating using Built-In mailer, am use custom mail server setting and it's work like a charm.

Sergey Kornilov admin 3/5/2013

This means mail is not configured properly in PHP settings on your web server. Simply use custom SMTP settings and this is it.

J
jackolantern author 3/12/2013



This means mail is not configured properly in PHP settings on your web server. Simply use custom SMTP settings and this is it.


I see, thank you Sergey.