Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Newsletter

  1. #1
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts

    Newsletter

    I am wondering how to send a newsletter to people. I know how to send mail to 1 person but sending it to more than 1 person.

    Table
    ------
    newsletter
    - firstname
    - lastname
    - email

    That is what my table looks like.

    I would like to make it send to everyone listed in the database and possibly have it customized to include their name in places (such as where i put [user]
    but don't know how. Can anyone give my some guidence in this process. Thanks.



    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Writing a mailing list application can become a very large project depending on what you need it to do. Unless you really just want to write one I would recommend not reinventing the wheel. I've been recommending this one to my clients for some time now and it works great.

    http://www.listmessenger.com/
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    put the data into an array, then loop thru the array
    Code:
    $array = // the data from the database
    
    $count = count($array);
    $i = 0;
    
    for ($i = 0; $i < $count; $i ++) (
      $name = $array[$i]['name'];
      $email = $array[$i]['email'];
      // and so on
    
      // define the email message
     
      // the code for sending the email
    
    }
    You get the idea

  • #4
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ARGHH! Why did this message stay?? Sorry about this post mods... please delete it...
    Last edited by l3vi; 06-09-2004 at 05:24 AM.

  • #5
    Regular Coder
    Join Date
    Jan 2003
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you know much about PHP? The best way IMO to do this is using loops. Maybe give each email/user in your database an ID number. Put your ID's in numerical order from the person who first subscribes, to the person who last subscribes, to make it easier to give out ID numbers. Then, in your loop, it will call this ID number. Then the script will find the first and last name, and email associated with that ID number.
    Im a little busy so I cannot tell you exact code you can use, but I can tell you what you need to research to find out how to do it on your own. And youll learn more Just go to www.php.net , (the best place for PHP learning/referencing) and look up the function for and while. Either of these should work if you use them correctly. Its actually fairly simple..

  • #6
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts
    I know a fair bit about PHP and Java Coding (although I don't need Java at all at the moment). I'll try the array and loop one, this seems simple enough, and I have never used an array in PHP before. THanks.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #7
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by litebearer
    put the data into an array, then loop thru the array
    Code:
    $array = // the data from the database
    
    $count = count($array);
    $i = 0;
    
    for ($i = 0; $i < $count; $i ++) (
      $name = $array[$i]['name'];
      $email = $array[$i]['email'];
      // and so on
    
      // define the email message
     
      // the code for sending the email
    
    }
    You get the idea
    $array = // the data from the database
    How would I go about getting the information into the array so I can retreive it, I would like to have the fname, lname and e-mail of the user as 1 part of the array.
    PHP Code:
    $array = { DawsonIrvine, [email]dniwebdesign@sasktel.net[/email]
                   
    JohnDoe, [email]johndoe@thepikes.com[/email]
                   
    JaySemko, [email]hello@jaysemko.com[/email] } 
    Is that correct or how would I go about doing it from a MySQL Database. Thanks.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •