473,898 Members | 3,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

html e-mail seding problem with php...

Hi to all,

I have the following html mail sender code written in php. It is
working properly but my problem is, code doesn't send the text
correctly which is in the varible "$mesaj". Code sends some unreadable
text. Any help would be appreciated, Thanx all.
Note: I put the sample image of the problem in:
http://www.wiliw.com/problem2.gif

Cem Louis

<?

$mesaj = "çÇiİıIşŞğĞ ";

$mailtext = "<html><hea d>";
$mailtext .= "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1254\">";
$mailtext .= "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=ISO-8859-9\">";
$mailtext .= "<meta http-equiv=\"content-language\" content=\"TR\"> ";
$mailtext .= "</head><body>";
$mailtext .= "$mesaj";
$mailtext .= "</body></html>";

$headers .= "MIME-Version: 1.0 \n" ;
$headers .= "From: the mailer<ma****@s ite.com> \n";
$headers .= "X-Sender:ma****@s ite.com \n";
$headers .= "X-Mailer:Mailing system (ab***@me.com) \n";
$headers .= "X-Priority: 3 \n";
$headers .= "Return-Path: ma****@site.com \n";
$headers .= "Content-Type:text/html;charset=wi ndows-1254 \n";

$email_to = "re*******@site .com";
$frommail = "ma****@site.co m";
$subject_line = "Got mail from the site!";

mail($email_to, $subject_line,$ mailtext, $headers);

?>
Jul 17 '05
15 2059
Hello,

On 07/10/2004 11:47 AM, Larry Jaques wrote:
>http://www.phpclasses.org/mimemessage

You provide a _very_ comprehensive class there, Manuel.
Do you by any chance have an instruction manual for it?
;)

Not yet. I can produce a reference manual soon from the class
auto-documentation. It would for instance like in this class:

http://www.phpclasses.org/xmlwriter

It will take me a few days. Just let me know if that would be useful.

Yes, please, VERY. I told my client I'd have her HTML newsletter up

It is almost done and I will probably release it later today, but if
you are in a hurry, you should look at the example scripts supplied
with the class.
-snip-

Now that things are back in context, how's it coming?


Sorry, extensive documentation is available on the site since late
Wednesday. I assummed that you were getting automatic notifications of
update of the class that goes to all subscribers that have previously
downloaded the class.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #11
On Sat, 10 Jul 2004 14:36:57 -0300, Manuel Lemos <ml****@acm.org >
calmly ranted:
Sorry, extensive documentation is available on the site since late
Wednesday. I assummed that you were getting automatic notifications of
update of the class that goes to all subscribers that have previously
downloaded the class.


No, I hadn't/haven't. I'll redownload it now and turn the
notifications back on while I'm there. Thanks.
--------------------------------------------
-- I'm in touch with my Inner Curmudgeon. --
http://diversify.com Comprehensive Website Development
=============== =============== =============== ===============

Jul 17 '05 #12
Manuel Lemos wrote:
Hello,

On 07/10/2004 05:11 AM, Daniel Tryba wrote:
Manuel Lemos <ml****@acm.org > wrote:
http://www.wiliw.com/problem2.gif
Messages with non-ASCII characters must be sent in quoted-printable
encoding.


This is not true for the body of a message, see rfc 2045 and look for
the 8bit and binary values for the content-transfer-encoding header.

Sorry, you cannot assume that the MTA that will get the message will
support 8 bit encoded messages or else your messages may get discarded
and then you wonder why the messages were not accepted. It is better to
play safe and let MTA convert to 8 bit when it knows it can do that.


And I would not assume that the email reader can understand HTML. Email
is best sent in ascii-text and if the MTA wants to convert it to HTML,
then it can...

Personally, I hate HTML mail -mainly because I primarily use a
ascii-text only reader - the other is security related.

Michael Austin.
Jul 17 '05 #13
Hello,

On 07/11/2004 11:33 PM, Michael Austin wrote:
Messages with non-ASCII characters must be sent in quoted-printable
encoding.


This is not true for the body of a message, see rfc 2045 and look for
the 8bit and binary values for the content-transfer-encoding header.
Sorry, you cannot assume that the MTA that will get the message will
support 8 bit encoded messages or else your messages may get discarded
and then you wonder why the messages were not accepted. It is better
to play safe and let MTA convert to 8 bit when it knows it can do that.


And I would not assume that the email reader can understand HTML. Email
is best sent in ascii-text and if the MTA wants to convert it to HTML,
then it can...


That is why you need to compose multipart/alternative to send HTML
properly because these can include both the plain text and HTML versions
that are displayed correctly depending on what your e-mail client can
display.

Every decent e-mail program can send messages this way. In PHP, you can
use the same class that I mentioned to compose it properly.

http://www.phpclasses.org/mimemessage
Personally, I hate HTML mail -mainly because I primarily use a
ascii-text only reader - the other is security related.


If you disable Javascript and objects that require plug-ins for viewing
HTML e-mail you are safe. If your concern is privacy (different than
security) you may use a cookies disabled mail program. I use Mozilla
Mail but you may prefer a smaller client.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #14
Manuel Lemos <ml****@acm.org > wrote:
This is not true for the body of a message, see rfc 2045 and look for
the 8bit and binary values for the content-transfer-encoding header.
Sorry, you cannot assume that the MTA that will get the message will
support 8 bit encoded messages or else your messages may get discarded
and then you wonder why the messages were not accepted.


Let's all stay in the stone age :)

It's a valid rfc, especially when one is going to use mime for html
attachments, so decent software should implement it.
It is better to play safe and let MTA convert to 8 bit when it knows
it can do that.


My terminal doesn't do 8bit, so nobody should use non-ascii characters
anywhere.

BTW although I personally don't have any unicode characterset installed,
I advocate the use of unicode (and utf-8 or utf-7 to transport it
safely).

--

Daniel Tryba

Jul 17 '05 #15
Hello,

On 07/12/2004 08:36 PM, Daniel Tryba wrote:
This is not true for the body of a message, see rfc 2045 and look for
the 8bit and binary values for the content-transfer-encoding header.
Sorry, you cannot assume that the MTA that will get the message will
support 8 bit encoded messages or else your messages may get discarded
and then you wonder why the messages were not accepted.

Let's all stay in the stone age :)

It's a valid rfc, especially when one is going to use mime for html
attachments, so decent software should implement it.


I don't think you understand the problem. Composing and sending messages
are usually separate steps. You only know if the SMTP server that
receives the message supports the 8 bit encoded messages after you
connect to it and query its capabilities. Since composition is done
before that, you can't make any assumptions when you compose the messages.

As long as you have software capable of composing messages encoded in 7
bit (ASCII), why bother trying to encode them with 8 bit characters?

If the receiving SMTP server thinks it is worth converting the messages
to an 8 bit encoding, let it do it at its own risk.

It is better to play safe and let MTA convert to 8 bit when it knows
it can do that.

My terminal doesn't do 8bit, so nobody should use non-ascii characters
anywhere.


If you only understand english, it probably does not make sense to
expect non ASCII messages. That is a problem of who reads the messages
not the MTA.
BTW although I personally don't have any unicode characterset installed,
I advocate the use of unicode (and utf-8 or utf-7 to transport it
safely).


I think you are confusing character sets with encodings. Unicode define
a character set that may be encoded as utf-8 or utf-7. You can use any 8
bit character set and encode it with quoted printable.

Quoted printable is what you should use to compose messages, not only
because the encoded messages only carry 7 bit characters despite they
may represent 8 bit text, but also it assures that the encoded message
lines do not exceed 75 characters even thouugh the text it self may have
lines of arbitrary length.
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3129
by: Himanshu Garg | last post by:
Hello, I am trying to pinpoint an apparent bug in HTML::Parser. The encoding of the text seems to change incorrectly if the locale isn't set properly. However Parser.pm in the directory (/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/) doesn't seem to contain the "real" parsing statements.
20
7368
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than Internet Explorer. Our computer expert in my company had told me already a while ago that I should learn HTML and encode myself. I was never inclined to do so (I am no computer expert), and when upon his suggestion I looked how my pages (converted to...
81
5212
by: sinister | last post by:
I wanted to spiff up my overly spartan homepage, and started using some CSS templates I found on a couple of weblogs. It looks fine in my browser (IE 6.0), but it doesn't print right. I tested the blogs, and one definitely didn't print right. Surveying the web, my impression is that CSS is very unreliable, because even updated browsers fail to implement the standards correctly. So should one just avoid CSS? Or is it OK if used...
82
6395
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility of getting wrong it seems I am on very shaky ground . For example, pretty much every book and web course on html that I have read tells me I must include <html>, <head> and <body> tag pairs. I have always done that, and never questioned it. ...
1
3697
by: Peter Williams | last post by:
Hello All, I'm a newbie to this ng. I'm posting here because I have a question about debugging some javascript on some pages of my website. Please don't call me a "troll" -- because I'm not one. :-))) The next page is called "basic_snake" and creates a message which follows the cursor. Up until today, I used this type of message attached to the mouse pointer for the following pages on my website: index.html, delphi.html &...
40
5641
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html401/strict.dtd"> <html> <head>
1
1566
by: Ryan Ginstrom | last post by:
I have been maintaining a body of documentation in plain HTML files. I would now like to automate the generation of the HTML files. Maintaining the HTML files now is tedious and error prone, because every time I move/remove/add a section, I have to renumber the following sections and update my internal links. I have looked at some of the HTML-generation frameworks, but the selection is somewhat bewildering, and most also seem geared to...
3
2021
by: radsat | last post by:
Hi I have a html page, which has some sites, when the user clicks on the site, <tr><td><a href="us.html" onclick = "setSiteCode('US')">USA</a></td></tr> and the javascript is, var siteCode = ""; function setSiteCode(site) { window.siteCode=site;
1
2179
by: reemamg | last post by:
Have a piece of code which works in Firefox however doesnt work in IE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT="">
0
11265
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10859
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10487
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8036
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5882
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3308
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.