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
In fact, by doing this, you will add the Mail.php file to the list of config files so that it can be executed
Email configuration
Now edit the .env file and replace your email config information there
Email sending code example
<?phpnamespaceApp\Controllers;
useWebrium\Mail;
class EmailController
{
publicfunctionsendEmail()
{
$mail = Mail::new();
// from$mail->setFrom("fromaddress@gmail.ir", "Farakhedmat Support");
// to$mail->addAddress("benkhalife@proton.me", "BEN");
$mail->Subject = "Test Email From api";
$mail->Body = "This is a test email sent using the test webrium";
if (!$mail->send()) {
echo"Mailer Error: " . $mail->ErrorInfo;
} else {
echo"Email sent successfully!";
}
}
}