Skip to content

Commit

Permalink
Renamed to fakemail
Browse files Browse the repository at this point in the history
Also reorganised
  • Loading branch information
manngo committed Jul 4, 2019
1 parent 266400a commit fa245b9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# shendmail
# fakemail

(Shell Sendmail)

A fake sendmail to enable testing of PHP mail functions. It will accept the input and save the results into a text file.

Expand All @@ -14,24 +13,24 @@ In php.ini search for:

remove the semicolon and change it to:

`sendmail+path=/path/to/shendmail`
`sendmail+path=/path/to/shendmail /path/to/anything.txt`
`sendmail+path=/path/to/fakemail`
`sendmail+path=/path/to/fakemail /path/to/anything.txt`

The first `/path/to/` should be the actual path of the program, while the `shendmail` should be one of the versions below.
The first `/path/to/` should be the actual path of the program, while the `fakemail` should be one of the versions below.

The second form allows you to specify the path of the text file. If not specified specified, it defaults to `mail.txt` in the same directory as the `shendmail` program.
The second form allows you to specify the path of the text file. If not specified specified, it defaults to `mail.txt` in the same directory as the `fakemail` program.

## Versions

Depending on your preferences, there are 4 versions:

| OS | Version | Description |
|---------|---------------|----------------------|
| MacOS | shendmail.sh | Shell Script |
| MacOS | shendmail | Command Line Program |
| Windows | shendmai.bat | Batch File |
| Windows | shendmail.exe | Executable |
| OS | Version | Description |
|---------|-----------------|----------------------|
| MacOS | `fakemail.sh` | Shell Script |
| MacOS | `fakemail` | Command Line Program |
| Windows | `fakemail.bat` | Batch File |
| Windows | `fakemail.exe` | Executable |

Whether you use the Script/Batch or the Program version is a matter of taste.

Note: If you use `shendmail.sh` on MacOS, you need to make sure that you set the permissions to something like `777`.
Note: If you use `fakemail.sh` on MacOS, you need to make sure that you set the permissions to something like `777`.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion notes/win.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Compiling on Windows with MinGW

set PATH=C:\mingw\bin;%PATH%;
gg++ shendmail.cpp -o shendmail.exe
gg++ fakemail.cpp -o fakemail.exe
File renamed without changes.
4 changes: 0 additions & 4 deletions source/shendmail.cpp → source/fakemail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
realpath(argv[0],buffer);
string cwd=dirname(buffer);

// cout<<cwd<<"\n";

// Define Input
string input;

Expand All @@ -38,8 +36,6 @@
ofstream output;
output.open(outputFile,ofstream::out | ofstream::app | ofstream::binary);

// cout<<outputFile<<"\n";

// Do the thing …
while(getline(cin,input)) {
output<<input;
Expand Down
2 changes: 1 addition & 1 deletion source/shendmail.sh → source/fakemail.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# chmod 744 sendmail.sh
# chmod 744 fakemail.sh
DIR=$(dirname "$0");
FILE="${DIR}/mail.txt"

Expand Down

0 comments on commit fa245b9

Please sign in to comment.