I'm going to make a newsletter on a website. I've tried to fint a script, but it's not very good. Do anyone have a link to a good script - which is free -, a tutorial or like?
I'm assuming by newsletter you want to send an email to a group of people.
I've never built something like this before, but I would do something like this.
Create a table in your database called "newsletter" with 3 fields ['id', 'name', 'email']
CREATE TABLE `demo`.`newsletter` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `name` VARCHAR( 125 ) NOT NULL , `email` TEXT NOT NULL ) ENGINE = MYISAM ;
On your php file get all the rows from the table, and in the while loop send a message to each user. In addition, if an email fails, add it to an array so you can echo each recipients name and email address.
<?php
$con = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('demo', $con);
$sql = \"SELECT * FROM `newsletter`\"; $res = mysql_query($sql) or die(mysql_error());
$sent_emails = array(); $failed_emails = array();
$subject = 'Hello %name%, Baylor sent you an email'; $message = <<<MSG Hello %name%,<br /> Thank you for subscribing to my website. MSG;
I mean something, where you on my website, can subscribe for a newsletter. Then all who subscribe get's collected in a list. When i want to send out a e-mail to everyone who has subscribed, i can log into a part of my website with a login, and make a message to them all.
Do you know a script like that, which is easy to set up?
I'm going to make a newsletter on a website. I've tried to fint a script, but it's not very good. Do anyone have a link to a good script - which is free -, a tutorial or like?
/Dev
I've never built something like this before, but I would do something like this.
Create a table in your database called "newsletter" with 3 fields ['id', 'name', 'email']
On your php file get all the rows from the table, and in the while loop send a message to each user. In addition, if an email fails, add it to an array so you can echo each recipients name and email address.
(I haven't tested this, but it should work)
Do you know a script like that, which is easy to set up?