basic repo set-up files, readme and license
This commit is contained in:
parent
0ade3fed4d
commit
23f0036018
82
.gitattributes
vendored
Normal file
82
.gitattributes
vendored
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# Common settings that generally should always be used with your language specific settings
|
||||||
|
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
# https://www.davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
#
|
||||||
|
# The above will handle all files NOT found below
|
||||||
|
#
|
||||||
|
|
||||||
|
# Documents
|
||||||
|
*.bibtex text diff=bibtex
|
||||||
|
*.doc diff=astextplain
|
||||||
|
*.DOC diff=astextplain
|
||||||
|
*.docx diff=astextplain
|
||||||
|
*.DOCX diff=astextplain
|
||||||
|
*.dot diff=astextplain
|
||||||
|
*.DOT diff=astextplain
|
||||||
|
*.pdf diff=astextplain
|
||||||
|
*.PDF diff=astextplain
|
||||||
|
*.rtf diff=astextplain
|
||||||
|
*.RTF diff=astextplain
|
||||||
|
*.md text
|
||||||
|
*.tex text diff=tex
|
||||||
|
*.adoc text
|
||||||
|
*.textile text
|
||||||
|
*.mustache text
|
||||||
|
*.csv text
|
||||||
|
*.tab text
|
||||||
|
*.tsv text
|
||||||
|
*.txt text
|
||||||
|
*.sql text
|
||||||
|
|
||||||
|
# Graphics
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.gif binary
|
||||||
|
*.tif binary
|
||||||
|
*.tiff binary
|
||||||
|
*.ico binary
|
||||||
|
# SVG treated as an asset (binary) by default.
|
||||||
|
*.svg text
|
||||||
|
# If you want to treat it as binary,
|
||||||
|
# use the following line instead.
|
||||||
|
# *.svg binary
|
||||||
|
*.eps binary
|
||||||
|
|
||||||
|
# Scripts
|
||||||
|
*.bash text eol=lf
|
||||||
|
*.fish text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
# These are explicitly windows files and should use crlf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
|
||||||
|
# Serialisation
|
||||||
|
*.json text
|
||||||
|
*.toml text
|
||||||
|
*.xml text
|
||||||
|
*.yaml text
|
||||||
|
*.yml text
|
||||||
|
|
||||||
|
# Archives
|
||||||
|
*.7z binary
|
||||||
|
*.gz binary
|
||||||
|
*.tar binary
|
||||||
|
*.tgz binary
|
||||||
|
*.zip binary
|
||||||
|
|
||||||
|
# Text files where line endings should be preserved
|
||||||
|
*.patch -text
|
||||||
|
|
||||||
|
#
|
||||||
|
# Exclude files from exporting
|
||||||
|
#
|
||||||
|
|
||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
.gitkeep export-ignore
|
||||||
|
vscode export-ignore
|
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/numbered-bookmarks.json
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
35
LICENSE
Normal file
35
LICENSE
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. SPECIAL NOTICE
|
||||||
|
This repo contains a copy of PHPMailer as obtained from
|
||||||
|
https://github.com/PHPMailer/PHPMailer. If you use any portion of code contained
|
||||||
|
within this repo that uses or references PHPMailer, you MUST abide by the
|
||||||
|
PHPMailer license as found in the above mentioned GitHub repo. The remainder of
|
||||||
|
this license in NO WAY applies to the PHPMailer code either in part or its
|
||||||
|
entirety.
|
||||||
|
|
||||||
|
All OTHER portions of code ('the Code') contained in this repo have been written
|
||||||
|
and developed by Asif Bacchus ('the Author'). You are hereby granted free and
|
||||||
|
unrestricted permission to use, redistribute and alter the Code in whatever
|
||||||
|
way(s) you desire or otherwise see fit under the following conditions:
|
||||||
|
|
||||||
|
1. AUTHOR DISCLAIMS ALL LIABILITY. PERIOD.
|
||||||
|
You understand the Author makes absolutely NO suggestion or implication
|
||||||
|
regarding the Code's suitability for any purpose. Furthermore, absolutely NO
|
||||||
|
guarantee or warranty of any nature is made regarding the safety, efficacy,
|
||||||
|
efficiency or purpose of the Code. The Author fully disclaims any liability
|
||||||
|
arising from your use of the Code.
|
||||||
|
|
||||||
|
2. CREDIT
|
||||||
|
Although not required, if you use any portion of the Code, please credit the
|
||||||
|
Author somewhere in your project or its associated documentation.
|
||||||
|
|
||||||
|
3. REDISTRIBUTION OF LICENSE
|
||||||
|
If you use any portion of the Code, you MUST include an unmodified copy of this
|
||||||
|
license somewhere in your project or its documentation. This clause applies
|
||||||
|
regardless of providing credit as per Clause (2).
|
||||||
|
|
||||||
|
4. ENTIRETY OF LICENSE
|
||||||
|
This file is the entirety of the licence. It is exactly 5 clauses including the
|
||||||
|
special notice about PHPMailer and contains exactly two-hundred sixty-three
|
||||||
|
words.
|
59
README.md
Normal file
59
README.md
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# Simple PHPMailer Test Script <!-- omit from TOC -->
|
||||||
|
|
||||||
|
Simple drop-in test page and script with no dependancies (outside the files in this repo) to determine if PHPMailer is working, if your ISP/host is blocking ports or if your mailserver doesn't like something you're doing.
|
||||||
|
|
||||||
|
- [usage](#usage)
|
||||||
|
- [configuration](#configuration)
|
||||||
|
- [on-page options](#on-page-options)
|
||||||
|
- [use-cases](#use-cases)
|
||||||
|
- [a word of caution](#a-word-of-caution)
|
||||||
|
- [final thoughts](#final-thoughts)
|
||||||
|
|
||||||
|
This script requires NO complex configuration or programming experience. Just provide your SMTP connection information, choose some combination of settings on the test page and read the formatted diagnostic logs to see what's going on.
|
||||||
|
|
||||||
|
This can be a welcome alternative when PHPMailer has been integrated into a complex piece of software like an e-commerce platform. Instead of fishing through thousands of lines of code to enable debugging output, you can use this simple test page to see the exact error(s) reported by your mail server.
|
||||||
|
|
||||||
|
## usage
|
||||||
|
|
||||||
|
1. Clone or extract this repo to the root of your website.
|
||||||
|
2. Fill-in your SMTP connection parameters in **config.php** and save the file.
|
||||||
|
3. Navigate to *your.domain.tld/mailertest*.
|
||||||
|
4. Fill-in the on-page options and click the 'TEST' button.
|
||||||
|
5. Read the full diagnostic log provided on screen.
|
||||||
|
|
||||||
|
## configuration
|
||||||
|
|
||||||
|
The *only* file you need to alter is **config.php**. Simply provide the information requested by the clearly named variables.
|
||||||
|
|
||||||
|
|variable|content|
|
||||||
|
|:---|:---|
|
||||||
|
|timeout|Time in seconds before terminating the SMTP connection attempt. Defaults to 15 seconds.|
|
||||||
|
|hostname|Address of your SMTP server. Example: mail.server.com|
|
||||||
|
|username|Username of account authorized to connect to the SMTP server.|
|
||||||
|
|password|Password of account authorized to connect to the SMTP server.|
|
||||||
|
|
||||||
|
## on-page options
|
||||||
|
|
||||||
|
- Ports: Select one of the commonly defined ports or specify an arbitrary port.
|
||||||
|
- Encryption: Select either no encryption, SSL or STARTTLS. Note that you can select a type of encryption that defies the standard setup as determined by your port choice. For example, you can select STARTTLS despite selecting port 465 which is 99% of the time SSL. This will likely generate an error that will appear in the displayed diagnostic log -- that is the point of this test-page :-)
|
||||||
|
- Recipient: Address to which you want the test email sent.
|
||||||
|
- Reply To: Address which will be used as the reply address of the test message.
|
||||||
|
|
||||||
|
## use-cases
|
||||||
|
|
||||||
|
- Since this repo is fully self-contained (all required files, modules, etc. are contained herein), it can be used to determine if your webhost supports PHPMailer independant of any other installed programs/scripts/etc.
|
||||||
|
- Since you can choose ports, you can easily check if your service provider/host is blocking certain ports (you will see a connection failure in the diagnostic logs).
|
||||||
|
- You can choose various combinations of encryption/no-encryption to determine how your target mail server is configured on particular ports.
|
||||||
|
- You can test your mail server's support for a reply address which may not correspond to the authenticated submitting account.
|
||||||
|
- Because an unabridged debug diagnostic log is clearly displayed, you can see each stage of the mail submission transaction, whether successful or not.
|
||||||
|
- The PHPMailer used by this test-page is independant and can be used to confirm/diagnose other installations of PHPMailer. For example, you can copy the settings you are using in another program and then use the debugging output provided by this script to see what's happening but not reported by the other program.
|
||||||
|
|
||||||
|
## a word of caution
|
||||||
|
|
||||||
|
The test page provided has NO safeguards against being used for spamming or other forms of abuse against a mail server or other users. Therefore, only keep this page installed/accessible for as long as you need to generate debug logs **then delete/disable the test-page!**
|
||||||
|
|
||||||
|
## final thoughts
|
||||||
|
|
||||||
|
I hope you find a use for this script and it helps you solve any problems you're experiencing using PHPMailer. I am NOT affiliated with PHPMailer, I just cobbled this together as a quick way to test unfamiliar webhosts and confirm my configurations are correct.
|
||||||
|
|
||||||
|
If you have any suggestions, feature-requests or find any bugs, please submit an issue!
|
Loading…
Reference in New Issue
Block a user