This topic is locked

E-mail ...

5/7/2009 10:48:30 AM
PHPRunner General questions
lewisgr author

I'm trying to figure out this e-mail feature but my host require authentication.
I've looked at all the posts about e-mailing and there not one that can explain anything well.
I just want to know how people are using this e-mail feature when you have to authenticate. Code Examples would be most helpful. Hopeful this post is a one stop shop on all e-mailing questions.
Thanks

Sergey Kornilov admin 5/7/2009

Unfortunately your web host doesn't make it easy for you. 99.9% of web hosting companies allow to send emails from PHP without authentication.
You have two choices:

  1. Change the web host
  2. Use PEAR to send SMTP authenticated emails
    If you choose the second way check this tutorial:

    http://email.about.com/od/emailprogramming...qt/et073006.htm

G
gchable 5/7/2009

Try this:

include("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();

$mail->SMTPAuth = true;

$mail->Host = "localhost";

$mail->Port = 26;

$mail->Username = "xxxx@xxxx.com";

$mail->Password = "xxxx";

$mail->From = "xxxx@xxxx.com";

$mail->FromName = "xxxxxxx";

$mail->Subject = "xxxxxxxxxxxxxxx";

$message="";
$message .= "<html>";

$message .= "<table border=\"0\" width=\"70%\" id=\"table1\" cellspacing=\"0\" cellpadding=\"0\">";

$message .= "<tr>";

$message .= "<td><font face=\"Verdana\" size=\"2\">NOMBRE</font></td>";

$message .= "<td><font face=\"Verdana\" size=\"2\">".$values["APELLIDO PATERNO"]." ".$values["APELLIDO MATERNO"]." ".$values["NOMBRE(S)"]."</font></td>";

$message .= "</tr>";

$message .= "</html>";
$mail->MsgHTML($message);

$mail->IsHTML(true);
$mail->AddAddress("xxxx@xxxx.com");

$mail->AddAddress($values["EMAIL_E"]);

$mail->AddAddress($values["EMAIL_N"]);
if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

header("Location: infonavit_list.php?a=return");

exit();

}


Visit http://phpmailer.codeworxtech.com/
best regards,

lewisgr author 5/7/2009

@gchable: Is this the code I would put in the event in PHPrunner?
And would you put the class.phpmailer.php in the same webfolder as the website being built?

Try this:


include("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();

$mail->SMTPAuth = true;

$mail->Host = "localhost";

$mail->Port = 26;

$mail->Username = "xxxx@xxxx.com";

$mail->Password = "xxxx";

$mail->From = "xxxx@xxxx.com";

$mail->FromName = "xxxxxxx";

$mail->Subject = "xxxxxxxxxxxxxxx";

$message="";
$message .= "<html>";

$message .= "<table border=\"0\" width=\"70%\" id=\"table1\" cellspacing=\"0\" cellpadding=\"0\">";

$message .= "<tr>";

$message .= "<td><font face=\"Verdana\" size=\"2\">NOMBRE</font></td>";

$message .= "<td><font face=\"Verdana\" size=\"2\">".$values["APELLIDO PATERNO"]." ".$values["APELLIDO MATERNO"]." ".$values["NOMBRE(S)"]."</font></td>";

$message .= "</tr>";

$message .= "</html>";
$mail->MsgHTML($message);

$mail->IsHTML(true);
$mail->AddAddress("xxxx@xxxx.com");

$mail->AddAddress($values["EMAIL_E"]);

$mail->AddAddress($values["EMAIL_N"]);
if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

header("Location: infonavit_list.php?a=return");

exit();

}


Visit http://phpmailer.codeworxtech.com/
best regards,

G
gchable 5/7/2009

@gchable: Is this the code I would put in the event in PHPrunner?



Yes, Before or After.......

And would you put the class.phpmailer.php in the same webfolder as the website being built?


class.phpmailer.php, class.smtp.php and language folder
./include

lewisgr author 5/8/2009

class.phpmailer.php, class.smtp.php and language folder


I didn't see a language folder. I downloaded verison 5.0.0
Thank you for all the help,



Yes, Before or After.......
class.phpmailer.php, class.smtp.php and language folder
./include

lewisgr author 5/11/2009

Is there a special way I need to add files to the /include folder? Because everytime I upload the project these files don't upload.



Yes, Before or After.......
class.phpmailer.php, class.smtp.php and language folder
./include