Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Newsletter

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27142
    Devilelites
    Member

    Hey,

    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

    #67903
    MJK
    Member

    Have you tried: http://www.mailchimp.com

    #67905
    BaylorRae
    Member

    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

    Code:
    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.

    Code:

    Thank you for subscribing to my website.
    MSG;

    while( $row = mysql_fetch_assoc($res) ) {
    $new_subject = str_replace(“%name%”, $row[‘name’], $subject);
    $new_message = str_replace(“%name%”, $row[‘name’], $message);

    if( mail($row[’email’], $new_subject, $new_message) ) {
    $sent_emails[] = “

    Email Sent To: ” . $row[‘name’] . ” – ” . $row[’email’] . “

    “;
    }else
    $failed_emails[] = “

    Email Not Sent To: ” . $row[‘name’] . ” – ” . $row[’email’] . “

    “;
    }

    foreach( $failed_emails as $message ) :
    echo $message;
    endforeach;

    ?>

    (I haven’t tested this, but it should work)

    #67930
    Devilelites
    Member

    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?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.