Debug: Database connection successful Housekeeping (Page 155) / Meta New Mars / New Mars Forums

New Mars Forums

Official discussion forum of The Mars Society and MarsNews.com

You are not logged in.

Announcement

Announcement: This forum is accepting new registrations via email. Please see Recruiting Topic for additional information. Write newmarsmember[at_symbol]gmail.com.

#3851 2025-09-10 14:13:46

SpaceNut
Administrator
From: New Hampshire
Registered: 2004-07-22
Posts: 29,637

Re: Housekeeping

todays post show in images how its not a single layer of materials in use.

Offline

Like button can go here

#3852 2025-09-12 09:58:22

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut ...

This post is about the banned members and the (currently suspended) email outreach campaign.

You may recall that I had an email outreach campaign going before the outage at the Mars Society server that revealed our software was out of date.  We updated the software and the forum is working, but the email service is apparently not working.

Thanks to your advice, we understand that the names/ID's in the "banned" table are currently "unbanned" by a manual procedure that you have to execute.  At one time you were attempting to perform that service, and were able to restore a number of people per day, but I am hoping we might be able to find a way to automate that process.  One option might be to simply empty the bans table.

That is something kbd512 could do with a (relatively simple) command (after a bit of research).

Please think about that to see if it makes sense to you?

Related to that idea, is the idea of running a MySQL command to set the membership status of all ID's on the banned list to Inactive.

We need to perform ** that ** operation before we clear the bans table.

I have a homework request for you!

Please see if my theory of how this would work is correct.

Please choose one ID from the banned list, and report on your experiences:

1) View the membership of the banned ID (I'm assuming most will be listed as "member").
2) See if you can change the membership of that ID to "Inactive" while the member is still banned
3) Finally, unban the ID

If my theory is correct, the ID should now be listed as Inactive and NOT banned.

In the next post, I will show you how Google might be able to automate the contact operation using our NewMarsMember account.

(th)

Offline

Like button can go here

#3853 2025-09-12 10:04:47

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

This post is for SpaceNut and kbd512.  All are welcome to study this and comment upon it.

The purpose of the conversation with Gemini was to see if Google can do something similar to what Mail Chip does.

The answer appears to be yes, and my first reading of the guidance is that this is something we could do, with a bit of study.

Our plan is to send only one email a day. That approach allows us to manage responses which would otherwise be overwhelming. Please re-evaluate your answer to see if there is a mechanism that would allow me to select an email address to receive a standard message? I developed an automated procedure using the web site email service, but that service is no longer available.

I understand. Your goal is to send a single, personalized email per day to your list of 1000 contacts and a new method to do so since your previous one is no longer available. This revised approach of a one-email-per-day sends is much more manageable and significantly changes the options available to you with Google's tools.

The solution that fits your needs best is using Google Apps Script with Google Sheets. This allows you to create a simple, automated, and personalized email sender that you can control and monitor directly from a spreadsheet. It essentially allows you to build your own mini-mail merge application.

Here is a step-by-step breakdown of how this can be set up:

1. The Google Sheets "Database"
First, you'll need a Google Sheet to serve as your mailing list.

Create a new Google Sheet: Open a new sheet and set up your columns.

Columns: The columns should include all the information you need. At a minimum, you will need:

Email Address

First Name (for personalization)

Last Name (for personalization)

Email Sent (This column is crucial for tracking. You will use it to mark which emails have been sent and when.)

2. The Google Apps Script
Google Apps Script is a JavaScript-based coding platform that lets you automate tasks across Google products. This is where you'll create the mechanism to send your one email a day.

Open the Script Editor: In your Google Sheet, click on Extensions > Apps Script.

Write the Script: You will write a short script that performs the following actions:

Reads the data from your Google Sheet.

Finds the first row that has a blank "Email Sent" column.

Gets the email address and name from that row.

Sends a personalized email to that person using the MailApp.sendEmail() function.

Writes the current date and time into the "Email Sent" column for that row.

Example Script:

JavaScript

function sendOneEmailPerDay() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  const dataRange = sheet.getDataRange();
  const values = dataRange.getValues();

  // Find the first row that hasn't had an email sent
  let rowToSend = -1;
  for (let i = 1; i < values.length; i++) {
    if (values[i][3] === "") { // Assuming "Email Sent" is the 4th column (index 3)
      rowToSend = i;
      break;
    }
  }

  // If there's a row to send, process it
  if (rowToSend !== -1) {
    const emailAddress = values[rowToSend][0]; // Assuming "Email Address" is the 1st column (index 0)
    const firstName = values[rowToSend][1]; // Assuming "First Name" is the 2nd column (index 1)

    // Draft your message
    const subject = "Update: Our Organization Is Back in Operation";
    const body = `Hello ${firstName},

We are writing to you today with some good news. We have successfully completed our recovery from the recent hacker attack and our services are now fully back in operation.

We sincerely apologize for any inconvenience this caused and appreciate your patience during this time.

Sincerely,
The [Your Organization] Team`;

    // Send the email
    MailApp.sendEmail(emailAddress, subject, body);

    // Update the "Email Sent" column to track that it's done
    sheet.getRange(rowToSend + 1, 4).setValue(new Date());
  }
}

3. Setting a "Time-Driven Trigger"
This is the key to your "one email a day" plan. You don't have to manually run the script. Apps Script can do it for you on a schedule.

Create a Trigger: In the Apps Script editor, click the clock icon on the left-hand menu (Triggers).

Add a new trigger:

Choose which function to run: Select sendOneEmailPerDay.

Select event source: Time-driven.

Select type of time-based trigger: Day timer.

Select time of day: Choose the time you want the email to be sent (e.g., between 8 a.m. and 9 a.m.).

Save: Click Save and authorize the script to send emails on your behalf.

Advantages of This Approach
Automated and Controlled: The script automatically runs once per day, sending only one email at a time.

Simple and Free: It uses only free Google services (Sheets and Apps Script). There are no additional costs or third-party add-ons required.

Personalization: The script allows you to use a template and personalize each message with the recipient's name.

Tracking: The "Email Sent" column provides a clear, real-time log of which emails have gone out, which allows you to manage the incoming responses at a manageable pace.

Bypasses Daily Limits: Because you're only sending one email per day, you are well within the daily sending limits for a standard Gmail account.

This method gives you the best of both worlds: the simplicity and security of the Google ecosystem with a custom, automated solution tailored specifically to your needs.

***

Thank you ** very ** much! This sounds quite practical! I'll report your suggested procedure to our currently active membership! Bravo!

***
That's fantastic to hear! I'm glad this solution works for you. Using Google Apps Script with Google Sheets is a great way to handle this specific task, and it gives you full control over the process without needing to rely on a third-party service.

Please let me know if you or your team have any questions as you begin to set it up. I'd be happy to help clarify any part of the process. Good luck!

(th)

Offline

Like button can go here

#3854 2025-09-13 08:13:48

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

NewMars is back up after an outage...  The site was down at 8 AM New Hampshire time, but back up a few minutes after 10 AM.

(th)

Offline

Like button can go here

#3855 2025-09-13 16:53:43

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut ....

The weekly Google meeting is coming up.  Please see if you can find time to run the experiment I requested.

You have more experience than anyone ease as Admin, so your guidance will be helpful!

Please go through the cycle I requested, document the results.

1) Select a banned id
2) Show the membership status for that id (eg, member?)
3) Unban that id using your manual method.
4) Show the membership status for that ID

I'm hoping that the unbanning process does NOT change the membership, but your test will find out.

My theory is that kbd512 can write a MySQL command that will convert every ID in the bans table to inactive.
Then we would empty the bans table (ie, set contents to null)

If my theory is correct, we should then have every member who was banned showing as inactive.

(th)

Offline

Like button can go here

#3856 2025-09-14 13:28:27

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut ... I decided to look at the Bans list again, and this time it appears that a moderator can edit the entry or remove it.

I chose this ID to work with: Maryjane

I performed the remove operation and Maryjane is now showing up as a member.

This appears to answer the question.

What is NOT clear at this point is what actions occur when the Remove command is executed.

I did find the php file that is executed when the Remove command is issued: del_ban=####

where #### is the number of the entry in the ban table.

kbd512 might be able to run a MySQL script to execute del_ban for every entry in the bans table.

There are 10 pages of bans, which might be 500 or it might be more depending upon page size.

I did see one note where a person was banned by James Burk. We want to keep that one banned, obviously.

I see SpaceNut banned a member at their request

Here's another that SpaceNut banned...

I found another banned by James Burk

OK ... now I'm pausing to rethink this.

I found 3 id's banned by kbd512

Most are banned by SpaceNut but I even found JushNH4H in the list and one ban by RobertDyck.

(th)

Offline

Like button can go here

#3857 2025-09-14 14:48:53

SpaceNut
Administrator
From: New Hampshire
Registered: 2004-07-22
Posts: 29,637

Re: Housekeeping

The username and the banned are 2 seperate tables of information.
The usernames are also linked to the user profile table which contains the email and other information.
There are some usernames that should not be removed as these would not follow simple rules.

The list of banned have 490 ish usernames that can be converted if we would desire to remove them from the banned.
The user profiles will need the username changed as well as the email content as well as putting it into the inactive list.

Changing the username to the group to inactive first does not change it from the banned as it remains banned as its the table of control for that user.

I see that poster seemed to be spamming a link of the same for every discusion as to why it got banned.

Offline

Like button can go here

#3858 2025-09-14 16:38:41

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut ... re #3857 ... thanks for getting back to me...

Now that I understand the situation better, I'm dropping the whole idea.

There are only (about) 500 names in the banned table, and they don't seem to be the ones I was wanting to contact.

Thanks again for giving some time to the question.

Please feel free to drop in this evening. We have nothing major on the agenda (that I know about).

An update on your home project would be welcome.

(th)

Offline

Like button can go here

#3859 Yesterday 06:32:53

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut re email setting in Administration menu...

By any chance, can you see the email address that is used by our email service?

I ask because the service is not working, and it may not have been working for some time. 

If you can spare a few minutes, please open your Admin window and see if you can see an email address that might have been set up when James Burk was Webmaster.  My guess is that whatever that email address was, it may no longer be in service.

We might be able to create a Gmail account for the service, and use that instead of the one that is there now.

If you can handle this it would be great, because kbd512 is in the midst of a very demanding project.

If you would be willing to take a look and send the email address you find to newmarsmember@gmail.com, that would be helpful.

I do not want to use newmarsmember for the outgoing email service, because that account is dedicated to serving our members.

Here is a message I sent to kbd512 today:

tahanson43206 wrote:

For kbd512 re email subsystem of forum ...

The email subsystem does not appear to be working.  It may not have been working for some time.  My working theory at this point is that the email address we have set in the database may not be enabled.  I'll try to find out what field is of interest.  My guess is that the field is in the configuration table in the MySQL database.  If the email address is not working, we might try an experiment of using our existing contact email address, or perhaps we could create a new Gmail address and simply use that.

If you want to (and have time to) look at the log, I ran a test this morning at UTC 12:15.26.0

The test was from my tahanson43206 user ID to the newmarsmember user ID.

The log would show the attempt to send an email, and that log entry should show the email address attempted.

The PHP module is misc.php and the parameter was ?email=431019

Update: I wonder if you as Admin might be able to look at the settings for the email service directly from your Admin window.

I'll ask SpaceNut.

(th)

Offline

Like button can go here

#3860 Yesterday 14:45:56

SpaceNut
Administrator
From: New Hampshire
Registered: 2004-07-22
Posts: 29,637

Re: Housekeeping

In the Admin, options the ser ver is blank but I do not remember if there was one.

SMTP server address   
The address of an external SMTP server to send emails with. You can specify a custom port number if the SMTP server doesn't run on the default port 25 (example: mail.myhost.com:3580). Leave blank to use the local mail program.

still researching

sent other information to you.

AI Overview
PHPMailer is a popular, open-source library for sending emails in PHP applications. It provides a robust and feature-rich way to send emails compared to the native mail() function in PHP, offering support for SMTP, attachments, HTML emails, and more secure handling of email sending.
Key features and uses of PHPMailer:
SMTP Support:
PHPMailer allows sending emails through an SMTP server, which is generally more reliable and secure than using the local mail() function. This is crucial for ensuring email deliverability and avoiding spam filters.
HTML Emails:
It facilitates sending emails with rich HTML content, including images and styling, for a more engaging user experience.
Attachments:
PHPMailer makes it easy to attach files to emails, such as documents, images, or other media.
Authentication and Encryption:
It supports various authentication methods and encryption protocols (SSL/TLS) for secure communication with SMTP servers.
Error Handling:
PHPMailer provides comprehensive error reporting, making it easier to diagnose and troubleshoot issues during email sending.
Flexible Recipient Management:
It allows setting multiple recipients, including CC and BCC, as well as reply-to addresses.
Using PHPMailer in a project typically involves:
Downloading and Including:
.
Obtaining the PHPMailer library (e.g., from GitHub or via Composer) and including the necessary files in your PHP script.
Instantiating PHPMailer:
.
Creating an instance of the PHPMailer class.
Configuring SMTP Settings:
.
Providing details for your SMTP server, including host, port, authentication credentials (username and password), and security settings (SSL/TLS).
Setting Sender and Recipient Information:
.
Specifying the sender's email address and name, as well as the recipient(s).
Composing the Email:
.
Setting the email subject, body (plain text or HTML), and adding any attachments.
Sending the Email:
.
Using the send() method to dispatch the email and handling potential errors.
Troubleshooting PHPMailer issues often involves:
Verifying SMTP server settings: Ensuring the host, port, and authentication details are correct.
Checking network connectivity: Confirming that your server can connect to the SMTP host.
Reviewing error logs: Examining PHPMailer's error messages for clues about the problem.
Consulting documentation and community resources: Referring to the official PHPMailer documentation, GitHub page, and online forums (like Stack Overflow or specific hosting/framework forums) for solutions to common issues.

Offline

Like button can go here

#3861 Yesterday 17:08:34

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 22,547

Re: Housekeeping

For SpaceNut re #3860

Thank you for checking the email server field, and for looking into the options that might be available.


The email service was working before the crash that took down Mars Society and NewMars.  We came back up in limping mode, thanks to kbd512 working with James Burk.  Eventually we upgraded the software to prevent failure if another crash occurs.  The reason we could not come up immediately was that our software was a decade out of date. 

My guess is that while we were in limping mode we lost access to the Mars Society SMTP server, and the lack has not been a major inconvenience.  A couple of members have commented upon the lack of the service.  The same problem exists at the phpBB3 site.  I've never set up an SMTP server there.

I wonder if Gmail might permit sending?  We Gmail users presumably are activating that functionality every time we send an email, but our browsers handle the transaction so we never see the details.

(th)

Offline

Like button can go here

Board footer

Powered by FluxBB