Lobby server feeds
-
We need to do a test mission where we need to get the e-mail alerts. But how do you do it on the local server? There's no need for a full-time host and a house, maybe there's some free analogs to just test?
-
Well, I have a local site, I use Google SMTP to send letters, look towards PHPMailer using Google SMTP.
Here's the example of the code.
$mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail $mail->Host = "smtp.gmail.com"; $mail->Port = 465; // or 587 $mail->IsHTML(true); $mail->Username = "email@gmail.com"; $mail->Password = "password"; $mail->SetFrom("example@gmail.com"); $mail->Subject = "Test"; $mail->Body = "hello"; $mail->AddAddress("email@gmail.com");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}