Welcome Guest, Not a member yet? Register   Sign In
Proper Mail Support
#1
Sad 

Current email support in CI4 is depressingly bad. it's should support for services like MailGun, Postmark, etc...
And queueing Mail and stuff...
Reply
#2

The Development Team has plans on replacing the Email Library with a new one.

Most of us like to use PhpMailer.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 02-04-2022, 03:11 AM by MrWhite.)

(02-04-2022, 01:21 AM)InsiteFX Wrote: The Development Team has plans on replacing the Email Library with a new one.

Most of us like to use PhpMailer.

Nice, thats a great move. there is no point re-inventing the wheel. its ok to embrace already exist well proven solution...
BTW I vote for https://symfony.com/doc/current/mailer.html
This one has so many features and amazing documentation than the PHPMailer library.
Reply
#4

You can use Symfony Mailer with CI4 now.

Code:
composer require symfony/mailer

PHP Code:
use Symfony\Component\Mailer\Transport;
use 
Symfony\Component\Mailer\Mailer;

$transport Transport::fromDsn('smtp://localhost');
$mailer = new Mailer($transport);

$email = (new Email())
    ->from('[email protected]')
    ->to('[email protected]')
    //->cc('[email protected]')
    //->bcc('[email protected]')
    //->replyTo('[email protected]')
    //->priority(Email::PRIORITY_HIGH)
    ->subject('Time for Symfony Mailer!')
    ->text('Sending emails is fun again!')
    ->html('<p>See Twig integration for better HTML integration!</p>');

$mailer->send($email); 

What do you need?
Reply
#5

(02-04-2022, 04:30 PM)kenjis Wrote: You can use Symfony Mailer with CI4 now.

Code:
composer require symfony/mailer

PHP Code:
use Symfony\Component\Mailer\Transport;
use 
Symfony\Component\Mailer\Mailer;

$transport Transport::fromDsn('smtp://localhost');
$mailer = new Mailer($transport);

$email = (new Email())
    ->from('[email protected]')
    ->to('[email protected]')
    //->cc('[email protected]')
    //->bcc('[email protected]')
    //->replyTo('[email protected]')
    //->priority(Email::PRIORITY_HIGH)
    ->subject('Time for Symfony Mailer!')
    ->text('Sending emails is fun again!')
    ->html('<p>See Twig integration for better HTML integration!</p>');

$mailer->send($email); 

What do you need?
of course i know that. and im using it. thats not the point of my thread. 
the built-in email solution is pretty primitive and not upto the requirements these days we have.
its great if can create a own CI4 mail interface that depends on a library like 'symonfy mailer' so we can compose require dat library and configure easily. currently we have to come up with  an elegant solution by ourself like creating a library and config files and stuff... thats kind of a drag.
Reply
#6

Okay, I understand you want a package that provides CI4 Email interface and uses Symfony Mailer as the backend.
Reply
#7

(02-04-2022, 07:41 PM)kenjis Wrote: Okay, I understand you want a package that provides CI4 Email interface and uses Symfony Mailer as the backend.

Yeah, something like in laravel email. laravel uses swiftmailer in their email functionality and gives nice interface to work with and specially configure. we can use a mail library like symfony mailer in our ci4 app. but its take bit of time to configure things and impliment a nice interface to work with. if we have out of the box nice interface thats brilliant.
Reply
#8

I understand what you want, and get it. And something similar is in the works. But correct me if I'm wrong, but Mailgun and Postmark can both be used through SMTP, correct? They have API's but I think most features are supported across the API and the SMTP interface.

I would be curious to see if the community is changing their minds at all, but during the development of CI4 they were very vocal about having the option to "download a zip and go", and many were open discouraging about any kind of Composer usage at all. So currently we've limited our usage of third-party libraries to a debugger which is only used during local development, and a security library because that's something better left in the hands of people who are really good at that, and that's not us Smile
Reply
#9

(This post was last modified: 02-06-2022, 01:05 AM by InsiteFX. Edit Reason: spelling error )

I just do not want to see CodeIgniter 4 become bloted like Laravel, I' m happy using a third party library.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#10

Email is rather a unique case. The current class is a direct port from CI3, barely updated to work with PHP7/8, and wrapped as a service. There aren’t any other components left so untouched, and the result is as OP noted: ugly.
Mailer is underway and scheduled to be included with our next release, 4.2. You can view its current state at the “refactor/email” branch. This endeavor was started by Jim, who didn’t get very far but left some ambitious interfaces. I took it over and wrote the majority of the code, using some other packages as references but Symfony’s Mailer was definitely one of the big inspirations.
I have no particular email experience; plodding through various protocol handshakes and handling encodings has been hair-pulling at times. We will need experience from the community to step up and contribute in order for this thing to be a success.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB