Automated mailing system html using gmail github

Here's a step-by-step guide to creating an automated mailing system using HTML, Gmail, and GitHub:

Step 1: Create a GitHub Repository

Step 2: Create an HTML Form

Step 3: Create a PHP Script

// Get form data $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message'];

// Send email using Gmail SMTP $smtp = 'smtp.gmail.com'; $port = 587; $username = '[email protected]'; $password = 'your-password';

// Create a new PHPMailer object $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = $smtp; $mail->Port = $port; $mail->SMTPAuth = true; $mail->Username = $username; $mail->Password = $password;

// Set email parameters $mail->setFrom($email, $name); $mail->addAddress($to, 'Recipient Name'); $mail->Subject = $subject; $mail->Body = $message;

// Send email if (!$mail->send()) { echo 'Error sending email: '. $mail->ErrorInfo; } else { echo 'Email sent successfully!'; } ?>


Replace `[email protected]` with the recipient's email, and `[email protected]` and `your-password` with your Gmail address and password.

**Step 4: Configure GitHub Pages**

* Go to your GitHub repository settings and click on "GitHub Pages".
* Select the branch you want to use for your GitHub Pages (e.g., "main").
* Set the "Source" to your `index.html` file.
* Click "Save" to save your changes.

**Step 5: Deploy Your Project**

* Go to your GitHub repository and click on the "Code" button.
* Click on the "Download ZIP" button to download your repository as a ZIP file.
* Extract the ZIP file to a directory on your local machine.
* Open the `index.html` file in a web browser to test your automated mailing system.

**Step 6: Set Up Gmail SMTP**

* Go to your Gmail account settings and click on "Forwarding and POP/IMAP".
* Enable "Less secure app access" to allow your PHP script to access your Gmail account.
* Note: This is not recommended for production use, as it may compromise your account security.

**Step 7: Test Your Automated Mailing System**

* Fill out the HTML form with your name, email, and message.
* Click the "Send" button to send the email.
* Check your recipient's email to see if the email was sent successfully.

That's it! You now have an automated mailing system using HTML, Gmail, and GitHub.