/    Sign up×
Community /Pin to ProfileBookmark

Hi

Can somebody help me here with a script that chooses randomly a specific info, compiles it, and sends automatically to a certain number of email addresses.

in another words, it chooses the info that I establish to choose and sends it to a number of clients emails everyday avoiding be treated as spam.

thank you

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiNov 24.2008 — Not without knowing where this info is coming from, where the email addresses are coming from, and how the number of clients is to be determined. Without that people can only offer vague advice.
Copy linkTweet thisAlerts:
@JoseSilvaauthorNov 24.2008 — Not without knowing where this info is coming from, where the email addresses are coming from, and how the number of clients is to be determined. Without that people can only offer vague advice.[/QUOTE]

Ok

  • 1. People register themselves to receive a monthly newsletter.

  • 2. The registrations are sored into a sql data base.

  • 3. Every 1st of each month I select the information that is also stored into sql data base, to be sent.

  • 4. instead of manually select the emails to send the newsletter, I need the computer to chosse every day starting from A to Z, 100 emails that are stored in DB, to send automatically the news letter.


  • I hope this clarifyes my needs.

    thank you
    Copy linkTweet thisAlerts:
    @MindzaiNov 24.2008 — OK I think I understand. I actually did something very similar at work recently so I might be able to help. I used the PEAR Mail_Queue() class to do this along with a cron job - it's exactly what it is designed for.

    So my first question is, do you have PEAR installed, or are you able to install it?

    Also just to completely clear, on point 4 in your post above, you have many emails stored in your database. Every day you want to pick the next 100 and send the newsletter to them. Then the next day you want to pick the next 100 and so on until the newsletter has been sent to everyone?
    Copy linkTweet thisAlerts:
    @JoseSilvaauthorNov 24.2008 — OK I think I understand. I actually did something very similar at work recently so I might be able to help. I used the PEAR Mail_Queue() class to do this along with a cron job - it's exactly what it is designed for.

    So my first question is, do you have PEAR installed, or are you able to install it?

    Also just to completely clear, on point 4 in your post above, you have many emails stored in your database. Every day you want to pick the next 100 and send the newsletter to them. Then the next day you want to pick the next 100 and so on until the newsletter has been sent to everyone?[/QUOTE]


    Ok

    As far I know the hosting server of my website does not have PEAR installed.

    The hosting webmail processor is HORDE.

    I apologise for the fact not to understand much of PEAR.

    Relating to the point number 4, my intention is: in beginning of every month I select the contents to set up the monthly newsletter. Then I set for example SEND and automatically the server send the 100 newsletters per day to diferent 100 registered clients. the registered emails are in the website database in the hosting server.

    Let's see if you understand now.

    thanks
    Copy linkTweet thisAlerts:
    @SyCoNov 25.2008 — Your idea has a fatal flaw when you have 3100 or more subscribers to your email.

    31 days @ 100 a day = a max of 3100 emails that can be sent. It's a monthly news letter but there is maybe 31 days between the first and last people getting the mail. That pretty old news.

    But here's how you could do it.

    Add a column to your emails table to track who has received the newsletter eg emailed type bit.
    [code=php]Select the top 100 (LIMIT 100) email where emailed=0[/code]
    send emails to retrieved addresses

    update the emailed column to 1 for these addresses. (check each mail send is successful and add id to array for a single query e.g.
    [code=php]UPDATE table WHERE id IN (implode(',', $mailed_ids))[/code]
    You might also want to log number of attempts so a bad address isn't called beyond a number of attempts.

    This will continue until you reach the end of your list where you need to check if the final number of email is 100 or less or the newsletter date is 30,31 or 28 days (depending on the month) old then update the emailed column to 0 and start again.

    Called daily with cron or task

    Honestly I think you need to rethink your idea.
    Copy linkTweet thisAlerts:
    @JoseSilvaauthorNov 25.2008 — Your idea has a fatal flaw when you have 3100 or more subscribers to your email.

    31 days @ 100 a day = a max of 3100 emails that can be sent. It's a monthly news letter but there is maybe 31 days between the first and last people getting the mail. That pretty old news.

    But here's how you could do it.

    Add a column to your emails table to track who has received the newsletter eg emailed type bit.
    [code=php]Select the top 100 (LIMIT 100) email where emailed=0[/code]
    send emails to retrieved addresses

    update the emailed column to 1 for these addresses. (check each mail send is successful and add id to array for a single query e.g.
    [code=php]UPDATE table WHERE id IN (implode(',', $mailed_ids))[/code]
    You might also want to log number of attempts so a bad address isn't called beyond a number of attempts.

    This will continue until you reach the end of your list where you need to check if the final number of email is 100 or less or the newsletter date is 30,31 or 28 days (depending on the month) old then update the emailed column to 0 and start again.

    Called daily with cron or task

    Honestly I think you need to rethink your idea.[/QUOTE]


    Ok

    I'll give it a try.

    probably you're right.


    My web site is www.agimoura.com. something funny happen when we select a certain property by reference. A blank space appears on top. I'm try to figure out what I did wrong bu really so far the more a look the lessI see.

    http://www.agimoura.com/newsearch.php?idioma=uk&tipo=&subcat=&vistas=&search=&min=&max=&ord=id&ord2=desc

    Can you give me any ideas?

    If you need I can send you the php file by mail.

    thanks
    ×

    Success!

    Help @JoseSilva spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...