Skip to content

geodelapaz/mailing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mailing Script

A simple script for sending an email with attachment

Installation

Install the composer dependencies

composer.phar install

Usage

Fill the necessary variables. Example:

$atttachment_url = 'https://docs.google.com/spreadsheets/d/FILE_ID/export?format=xlsx';
$target_email = ['[email protected]', '[email protected]'];

$email_server = 'mail.example.com';
$email_port = 587;
$email_username = '[email protected]';
$email_name = 'Sender Man';
$email_password = 'f00b@r';

$subject_content = 'This is an email';
$body_content = 'Hi Bros, kindly see the attachment provided';

$file_name = 'attachment.xlsx';

How to test

php -d allow_url_fopen=true /path/to/mailer/script/main.php >/dev/null 2>&1

Sample usage for running the emailer every 7pm, Monday to Friday

crontab -e

0 19 * * 1-5 /usr/bin/php -d allow_url_fopen=true /path/to/mailer/script/main.php >/dev/null 2>&1

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Quick mailing script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages