You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
No response
What happened?
I've tried to setup email sender using CodeIgniter Email class. I use SMTP configuration with SMTPCrypto=tls, SMTPPort=587 and other auth configuration. Then it shows this debug message:
hello:
The following SMTP error was encountered:
starttls:
The following SMTP error was encountered:
Unable to send email using SMTP. Your server might not be configured to send mail using this method.
Date: Wed, 12 Feb 2025 17:35:25 +0700
To: [email protected]
Subject: =?UTF-8?Q?SMTP=20Email=20Testing?=
From: "Masagi" <[email protected]>
Return-Path: <[email protected]>
Reply-To: <[email protected]>
User-Agent: Tarbiyya
X-Sender: [email protected]
X-Mailer: Tarbiyya
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_67ac796d34a404.14803652"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_67ac796d34a404.14803652
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is sample body of email testing using SMTP.
--B_ALT_67ac796d34a404.14803652
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
This is sample body of email testing using SMTP.
--B_ALT_67ac796d34a404.14803652--
For comparison, I try to use PHPMailer package with same configuration I've set in Config\Email class and it sent the message successfully. I use SMTP account from Hostinger.
Steps to Reproduce
This is my sample code:
// CodeIgniter Email$email = service("email");
$email->setTo("[email protected]");
$email->setSubject("SMTP Email Testing");
$email->setMessage("This is sample body of email testing using SMTP.");
$email->send(false);
echo$email->printDebugger();
// PHPMailer$mail = newPHPMailer(true);
$EmailConfig = new \Config\Email;
try {
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->Host = $EmailConfig->SMTPHost;
$mail->SMTPAuth = true;
$mail->Username = $EmailConfig->SMTPUser;
$mail->Password = $EmailConfig->SMTPPass;
$mail->SMTPSecure = $EmailConfig->SMTPCrypto; // 'tls'$mail->Port = $EmailConfig->SMTPPort; // 587$mail->setFrom($EmailConfig->fromEmail, $EmailConfig->fromName);
$mail->addAddress('[email protected]');
$mail->isHTML(true);
$mail->Subject = 'SMTP Email Testing';
$mail->Body = 'This is sample body of email testing using SMTP.';
$mail->send();
echo'Message has been sent';
} catch (Exception$e) {
echo"Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Expected Output
I don't know if I missed something in my configuration or if there is an error in the Email class.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
yllumi
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Feb 12, 2025
220 ESMTP smtp.hostinger.com
hello: 250-smtp.hostinger.com
250-PIPELINING
250-SIZE 48811212
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
starttls: 220 2.0.0 Ready to start TLS
hello: 250-smtp.hostinger.com
250-PIPELINING
250-SIZE 48811212
250-ETRN
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
from: 250 2.1.0 Ok
to: 250 2.1.5 Ok
data: 354 End data with .
250 2.0.0 Ok: queued as 4YtnkF3L5YzF8gN4
quit: 221 2.0.0 Bye
Your message has been successfully sent using the following protocol: smtp
<here goes the message>
PHP Version
8.3
CodeIgniter4 Version
4.6.0
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
No response
What happened?
I've tried to setup email sender using CodeIgniter Email class. I use SMTP configuration with SMTPCrypto=tls, SMTPPort=587 and other auth configuration. Then it shows this debug message:
For comparison, I try to use PHPMailer package with same configuration I've set in Config\Email class and it sent the message successfully. I use SMTP account from Hostinger.
Steps to Reproduce
This is my sample code:
Expected Output
I don't know if I missed something in my configuration or if there is an error in the Email class.
Anything else?
No response
The text was updated successfully, but these errors were encountered: