{"id":18517885,"url":"https://github.com/fuel/email","last_synced_at":"2025-05-16T00:06:16.107Z","repository":{"id":1694132,"uuid":"2422516","full_name":"fuel/email","owner":"fuel","description":"Fuel PHP Framework - Fuel v1.x Email library","archived":false,"fork":false,"pushed_at":"2024-12-25T19:12:14.000Z","size":239,"stargazers_count":59,"open_issues_count":1,"forks_count":37,"subscribers_count":10,"default_branch":"1.9/develop","last_synced_at":"2025-04-08T11:09:30.626Z","etag":null,"topics":["fuel-v1","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-20T13:27:17.000Z","updated_at":"2025-02-07T11:18:27.000Z","dependencies_parsed_at":"2025-01-18T22:41:04.862Z","dependency_job_id":null,"html_url":"https://github.com/fuel/email","commit_stats":{"total_commits":160,"total_committers":34,"mean_commits":4.705882352941177,"dds":0.64375,"last_synced_commit":"c25ff9c655d5b454fb44980bfa251540ed99c5ce"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuel%2Femail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuel%2Femail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuel%2Femail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuel%2Femail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuel","download_url":"https://codeload.github.com/fuel/email/tar.gz/refs/heads/1.9/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuel-v1","php"],"created_at":"2024-11-06T17:10:08.651Z","updated_at":"2025-05-16T00:06:16.086Z","avatar_url":"https://github.com/fuel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuel Email Package.\n\nA full fledged email class for Fuel. Send mails using php's mail function, sendmail or SMTP.\n\n# Summary\n\n* Send plain/text or html with (optional) alternative plain/text bodies using mail, sendmail or SMTP.\n* Add attachments, normal or inline and string or file.\n* Automatic inline file attachments for html bodies.\n* Configurable attachment paths.\n\n# Usage\n\n\t$mail = Email::forge();\n\t$mail-\u003efrom('me@domain.com', 'Your Name Here');\n\t\n\t// Set to\n\t$mail-\u003eto('mail@domain.com');\n\t\n\t// Set with name\n\t$mail-\u003eto('mail@domain.com', 'His/Her Name');\n\t\n\t// Set as array\n\t$mail-\u003eto(array(\n\t\t// Without name\n\t\t'mail@domain.com',\n\t\t\n\t\t// With name\n\t\t'mail@domain.com' =\u003e 'His/Her Name',\n\t));\n\t\n\t// Work the same for -\u003ecc and -\u003ebcc and -\u003ereply_to\n\t\n\t\n\t// Set a body message\n\t$email-\u003ebody('My email body');\n\t\n\t// Set a html body message\n\t$email-\u003ehtml_body(\\View::forge('email/template', $email_data));\n\t\n\t/**\n\t\n\t\tBy default this will also generate an alt body from the html,\n\t\tand attach any inline files (not paths like http://...)\n\t\n\t**/\n\t\n\t// Set an alt body\n\t$email-\u003ealt_body('This is my alt body, for non-html viewers.');\n\t\n\t// Set a subject\n\t$email-\u003esubject('This is the subject');\n\t\n\t// Change the priority\n\t$email-\u003epriority(\\Email::P_HIGH);\n\t\n\t// And send it\n\t$result = $email-\u003esend();\n\n# Exceptions\n\n\t+ \\EmailValidationFailedException, thrown when one or more email addresses doesn't pass validation\n\t+ \\EmailSendingFailedException, thrown when the driver failed to send the exception\n\nExample:\n\n\t// Use the default config and change the driver\n\t$email = \\Email::forge('default', array('driver' =\u003e 'smtp'));\n\t$email-\u003esubject('My Subject');\n\t$email-\u003ehtml_body(\\View::forge('email/template', $email_data));\n\t$email-\u003efrom('me@example.com', 'It's Me!');\n\t$email-\u003eto('other@example.com', 'It's the Other!');\n\t\n\ttry\n\t{\n\t\t$email-\u003esend();\n\t}\n\tcatch(\\EmailValidationFailedException $e)\n\t{\n\t\t// The validation failed\n\t}\n\tcatch(\\EmailSendingFailedException $e)\n\t{\n\t\t// The driver could not send the email\n\t}\n\t\n# Priorities\n\nThese can me one of the following:\n\n\t+ \\Email::P_LOWEST - 1 (lowest)\n\t+ \\Email::P_LOW - 2 (low)\n\t+ \\Email::P_NORMAL - 3 (normal) - this is the default\n\t+ \\Email::P_HIGH - 4 (high)\n\t+ \\Email::P_HIGHEST - 5 (highest)\n\t\n# Attachments\n\nThere are multiple ways to add attachments:\n\n\t$email = Email::forge();\n\t\n\t// Add an attachment\n\t$email-\u003eattach(DOCROOT.'dir/my_img.png');\n\t\n\t// Add an inline attachment\n\t// Add a cid here to point to the html\n\t$email-\u003eattach(DOCROOT.'dir/my_img.png', true, 'cid:my_conten_id');\n\t\n\nYou can also add string attachments\n\n\t$contents = file_get_contents($my_file);\n\t$email-\u003estring_attach($contents, $filename);\n\t\nBy default html images are auto included, but it only includes local files.\nLook at the following html to see how it works.\n\n\t// This is included\n\t\u003cimg src=\"path/to/my/file.png\" /\u003e\n\t\n\t// This is not included\n\t\u003cimg src=\"http://remote_host/file.jpeg\" /\u003e\n\n\nDrivers\n=======\nThe drivers allow the use of this library with mostly anything that can send mails.\n\n### Mailgun\nMailgun is an online service by Rackspace (http://www.mailgun.com/) that allows you to send emails by demand. You will need to install the mailgun library (https://github.com/mailgun/mailgun-php) with composer in your FuelPHP.\n\nOnce you have installed the package you will have to set up the config for your App:\n\n```php\n\u003c?php\nreturn array(\n\t/**\n\t * Override default Email.php settings\n\t */\n\t'defaults' =\u003e array(\n\t\t'driver' =\u003e 'mailgun',\n\t\t'mailgun' =\u003e array(\n\t\t\t'key' =\u003e 'YOUR KEY',\n\t\t\t'domain' =\u003e 'YOUR DOMAIN',\n\t\t\t'endpoint' =\u003e null | 'OPTIONAL ALT. API ENDPOINT URL' // e.g. 'https://api.eu.mailgun.net/v3'\n\t\t),\n\t),\n);\n```\n\n# That's it. Questions? \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuel%2Femail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuel%2Femail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuel%2Femail/lists"}