CodeIgniter Forums

Full Version: Email default protocol
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Perkin5[/eluser]
The default for sending emails from CI 2.1.3 is 'mail'. I think I understand what 'sendmail' and 'smtp' do but what protocol does the default 'mail' use?

Sorry if this has been answered before but I couldn't find anything on search.

El Forum

[eluser]Harold Villacorte[/eluser]
It looks to me like php's mail() function.

El Forum

[eluser]Perkin5[/eluser]
So what protocol does that use?

El Forum

[eluser]Harold Villacorte[/eluser]
The CI mail protocol uses the PHP mail() function which uses sendmail.
The sendmail protocol uses sendmail directly.
The smtp protocol works the way PHPMailer does. It bypasses the server and your application acts like a mail client.

El Forum

[eluser]Perkin5[/eluser]
So mail and sendmail are essentially identical?

El Forum

[eluser]Harold Villacorte[/eluser]
Mail uses mail() which is very simple. Sendmail uses popen() to run sendmail. One may work for you where the other does not or it might be that neither works. Smtp usually works for everyone.

El Forum

[eluser]Perkin5[/eluser]
Thanks so much for that info - I think it's smtp for me!

El Forum

[eluser]InsiteFX[/eluser]
You need to setup your mail configuration in your php.ini file for sendmail and smtp.

El Forum

[eluser]Perkin5[/eluser]
Already done that and smtp is working OK.

Many thanks for your help