Answer the question
In order to leave comments, you need to log in
What is a simple class for working with mail in php?
Tell me, is there a simple class for sending mail from the site? Just the title and body of the message. Of course, you can use the built-in mail () function, but somehow you don’t want to reinvent the wheel)
Answer the question
In order to leave comments, you need to log in
You don't have to invent anything.
In any incomprehensible situation PHPMailer
Here is an example from the TOASTER))) YES, YES, there is also a search:
Как отправить письмо если mail() на сервере отключен?
require_once(JPATH_SITE.'/libraries/phpmailer/phpmailer.php');
$mail = new PHPMailer;
$sender = array($call_email, JText::_('modcallback_title'));
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'ssl://smtp.yandex.ru';
$mail->Port = 465;
$mail->SMTPSecure = 'SSL';
$mail->SMTPAuth = true;
$mail->Username = $call_email;
$mail->Password = "";// Пароль
$mail->setFrom($sender);
$mail->addReplyTo($sender);
$mail->addAddress($sender);
$mail->Subject = 'subjec't;
$mail->Body = 'Body';
return $mail->send();
$mhSmtpMail_Server = "ssl://smtp.yandex.ru";
There is an option for those who have their own server (physical or virtual) and for whom the functionality of the built-in mail () function is enough.
Example for Yandex:
account default
host smtp.yandex.ru
port 465
from [email protected]
auth plain
user [email protected]
password Pa$$w0rD
tls on
tls_certcheck off
man msmtp
. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question