PHP code example of wildye / email-parser-laravel
1. Go to this page and download the library: Download wildye/email-parser-laravel library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wildye / email-parser-laravel example snippets
use Illuminate\Support\Facades\Event;
use Wildye\EmailParser\Laravel\Events\InboundEmailReceived;
Event::listen(function (InboundEmailReceived $event) {
$email = $event->email; // Wildye\EmailParser\InboundEmail
Ticket::firstOrCreate(['thread_id' => $email->threadId])
->replies()->firstOrCreate(['message_id' => $email->messageId], [
'from' => $email->from?->address,
'body' => $email->replyText,
'order_number' => $email->field('order_number'),
]);
});
use Wildye\EmailParser\Email;
use Wildye\EmailParser\Laravel\Facades\EmailParser;
$sent = EmailParser::send(
Email::create()
->from('[email protected] ')
->fromName('Derek Wildman') // "Derek Wildman <[email protected] >"
->to('[email protected] ')
->subject('Camp kit list')
->text('Hi, the kit list is attached.')
);
$sent->fromName; // "Derek Wildman"
use Wildye\EmailParser\Laravel\Facades\EmailParser;
EmailParser::sendSample();
EmailParser::forAccount($subAccountId)->domains()->create('bobsbakery.com', inboundEnabled: true); // resellers