PHP Classes

content type and charset

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  content type and charset  >  (Un) Subscribe thread alerts  
Subject:content type and charset
Summary:Content-Type: text/html; charset="utf-8" will better
Messages:4
Author:Kakhaber Kashmadze
Date:2016-01-19 08:39:02
 

  1. content type and charset   Reply   Report abuse  
Picture of Kakhaber Kashmadze Kakhaber Kashmadze - 2016-01-19 08:39:02
When sending utf-8 message there is unknonwn symbols. because there is not setted charset and email client by default has character encoding Western.

If there will be setCharset method will better for using


  2. Re: content type and charset   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-01-19 18:25:51 - In reply to message 1 from Kakhaber Kashmadze
The SMTP class just sends messages, it does not compose them.

Use the MIME message class together with this class to properly compose messages and send them via SMTP.

phpclasses.org/package/9-PHP-PHP-ma ...

Take a look at the test_smtp_message.php example script:

phpclasses.org/package/9-PHP-PHP-ma ...

  3. Re: content type and charset   Reply   Report abuse  
Picture of Kakhaber Kashmadze Kakhaber Kashmadze - 2016-01-20 06:08:57 - In reply to message 2 from Manuel Lemos
I see it is a good job, but it is simple to use one class like PHPMailer than so many classes if result is same.

  4. Re: content type and charset   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-01-20 18:29:55 - In reply to message 3 from Kakhaber Kashmadze
I am not sure what you mean.

Anyway, composing messages according to the standards can be a complex task. That is why a more complex package is necessary.

If you want to just use the SMTP class, you can just add the headers to set the Content-Type at the beginning of the message before the body but you need to know how to do it correctly.