Page 1 of 1

php outgoing mailing list SMTP help

Posted: Thu Apr 09, 2009 6:52 pm
by luke_barnes
i have made a MYSQL database and linked up a crude php page so that a message can be sent to all on the mailing list.

im having trouble getting a mail host. im new to PHP and so am unsure how to go about this. i have found a website that says i can use googlemail/gmail as a free SMTP server. this is the site: http://www.geekzone.co.nz/tonyhughes/599

this is the section of the code:

<?php

require('connect.php');

//change php.ini smtp line
ini_set("SMTP", "");

//standard mail header
$headers = "From: admin@slumkingtrampart.com";

//get message to send
$message = $_GET['message'];

//loop through
for($x=0;$x<count($_GET);$x++)
{
if ($_GET["mail_$x"])
{

//mail setup
$to = $_GET["mail_$x"];
$subject = "Newsletter";
$body = "Dear ".$_GET["name_$x"]."
\n\n $message \n\n
PHP Academy.";

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

}
}

echo "All mail has been processed.";

?>

i have seen this code work with the Shefeild uni mailhost but obviously i dont have access to this so it dosnt work.

to be honest i dont even know if this gmail thing is what i'm looking for. any help would be great. i'm a bit of a PHP novice so im not sure what im doing.

thanks in advance

Luke.

Re: php outgoing mailing list SMTP help

Posted: Fri Apr 10, 2009 3:40 am
by corkman
I don't think that php mail function will work with google's smtp, because google uses TLS encryption for communication.

Try to look here:
http://www.xpertmailer.com/

Re: php outgoing mailing list SMTP help

Posted: Fri Apr 10, 2009 6:00 am
by luke_barnes
if that wont work any idea ware i can get a free or low cost mail host?