Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:02:35+00:00 2026-06-03T00:02:35+00:00

Basically, am creating a mailer system to send a mail to my inactive members

  • 0

Basically, am creating a mailer system to send a mail to my inactive members to do activities in their account if they have not logged in since 30 days.

My previous login date stores in my database in unixtimestamp hence I coded as below.

  select email from myusers where WHERE DATE_ADD(FROM_UNIXTIME(prelogin), INTERVAL 30 DAY) < CURDATE()";

But this code after 30 days it is sending continuos mails almost everyday as I have set cron to run once a day.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:02:36+00:00Added an answer on June 3, 2026 at 12:02 am

    Assuming you only want an email sent every 30 days, and only if they haven’t logged in for 30 days, I suspect the easiest solution will be to have another column in your table called something like last_email_sent_time.

    Then, only send an email if it’s been at least 30 days since both prelogin and that new column.

    And, when you send the email, update that new column to the current date so you won’t bother them for another month or so.


    On the other hand, if you just want the email sent once after they haven’t logged in for thirty days, it’s a similar thing.

    Create a new column indicating the email has been sent and only send it if that column is false (or N or whatever you want to use to indicate it). Sending it will set that column to true, logging in will set it to false (as well as changing prelogin).


    If you don’t want to add extra columns (for some bizarre reason), you could simply update prelogin when you send the email, though that’s not something I’m comfortable suggesting since it loses information that may be used (or useful) elsewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have a tabbed Panel I'm creating. When the user click on a
I have been given a new task from the client which is basically creating
I'm basically creating a display-module for an ad-system I've created. I'm trying to avoid
Basically i am creating a vbnet system software. I want to create a shortcut
One simple method I've used in the past is basically just creating a second
Basically I am creating a database driven website in Web Developer 2008. The database
I just need help. Basically I am creating a windows appllication that sends bulk
Basically, I am creating an XML file by taking the values from a column
I am creating an application that basically places a drawable into an imageView onClick.
i am creating a bluetooth based server program in Bluez which basically handles connections

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.