Send mail from CI4, same configuration as CI3 doesn't work |
I have an application in Codeigniter 3 that I'm converting to Codeigniter 4, I have a problem that I can't solve by sending mail
in Codeigniter 3, in the config/email.php file I have this configuration currently working PHP Code: $config['protocol'] = 'smtp'; Now in Codeigniter 4 I put the same parameters in the new configuration file in Config/Email.php PHP Code: namespace Config; The mail is not sent and doing a debug, the result is this: Quote:Unable to send email using SMTP. Your server might not be configured to send mail using this method. Now, what am I doing wrong in CI4? Why does it work with the same configuration in CI3?
Check the following posts:
https://forum.codeigniter.com/showthread...pid=402758 https://forum.codeigniter.com/showthread...pid=394631 Maybe this helps you.
(03-22-2023, 09:32 AM)JustJohnQ Wrote: Check the following posts: I can't find an answer to my problem
if you have a google email account you can try using that . eg smtp.gmail.com
The "username" will be your google email address, and you can use 2 step security function to generate a password , specifically for use of sending emails from your web. this line looks a bit odd not even mentioning SMTP Code: public $SMTPHost = 'ssl://cpanel.adamisgroup.it'; # I don't use CI4 for sending emails , instead I use PHPMailer which you can install using composer. It works on my apache web dev on Arch Linux, so I can play about with it and test it with catch blocks ; and it works fine from live hosting .
(03-22-2023, 11:49 AM)captain-sensible Wrote: if you have a google email account you can try using that . eg smtp.gmail.com It's not a matter of trying with different things, the question is why with the same configurations it works in CI3 and not in CI4, what's different, what needs to be changed, modified or whatever
CI4 is still being continuously improved; most CI3 config works fine, but not all are the same.
Or this may be just a bug. Try PHP Code: public $SMTPHost = 'cpanel.adamisgroup.it';
@serialkiller Your CI3 config does not have smtp_crypto, but CI4 config has SMTPCrypto = 'ssl'.
These configs are not the same.
(03-23-2023, 04:13 AM)kenjis Wrote: @serialkiller Your CI3 config does not have smtp_crypto, but CI4 config has SMTPCrypto = 'ssl'. kenjis, you are always irreplaceable, thank you so much, truly |
Welcome Guest, Not a member yet? Register Sign In |