There is a handy library to send emails via smtp in php?
I would like a class of some kind, which normally would be sent via smtp the needed letters in the html utf-8 format and was able to attach files attached. server smtp Yandex, respectively using ssl must be able to work.
somehow I can not yet find on github same like many finds on php smtp, but something a lot of unknown things with unknown or missing documentation. and to sit to try each that long, then still try to understand why the name of the sender does not understand the Cyrillic alphabet or subject line half the mail clients are displayed normally, while others do not.
it seems to me that the question is not new and there is somewhere a good fit script with sane documentation and features...
2 answers
Find more questions by tags SMTPDigital certificatesPHP
class Mailer extends PHPMailer {
/**
* Save email to a folder (via IMAP)
*
* This function will open an IMAP stream using the email
* credentials previously specified, and will save the email
* to a specified folder. Parameter is the folder name (ie, Sent)
* if nothing was specified it will be saved in the inbox.
*
* David Tkachuk
*/
public function copyToFolder($folderPath = null) {
$message = $this->MIMEHeader . $this->MIMEBody;
// $path = "INBOX" . (isset($folderPath) && !is_null($folderPath) ? ".".$folderPath : ""); // Location to save the email
$imapStream = imap_open("{imap.yandex.EN:993/ssl/novalidate-cert}" . mb_convert_encoding( 'Sent contracts', "UTF7-IMAP", "UTF-8" ) , $this->Username, $this->Password);
imap_append($imapStream, "{imap.yandex.EN:993/ssl/novalidate-cert}" . mb_convert_encoding( 'Sent contracts', "UTF7-IMAP", "UTF-8" ), $message,"\\Seen");
imap_close($imapStream);
}
}
$mail = new Mailer();
//...
$mail->copyToFolder();
[/code] - Kailey.Moore63 commented on July 9th 19 at 14:22