473,804 Members | 3,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML email using PHP problem (Receive html tags)

Hi all,

When I send the html email, the only thing I receive is the tags (the
html codes basically). I want to be able to see the email like a html
page, what is wrong with my code? Here is a copy paste of it.

$HTML = "</html><body><img src='http://www.somewebsite .com/
someimage.jpg'> </body></html>";

$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEM O");
// Now we attach the HTML version

$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n" ;

$headers .= chunk_split(bas e64_encode($HTM L));

mail($to,$subje ct,"",$headers) ;

print "mail Sent<br>";
The email I receive has this as text:

</html><body><img src='http://www.somewebsite .com/someimage.jpg'> </
body></html>

Thanks!

May 18 '07 #1
6 3262
pa***********@g mail.com wrote:
I want to be able to see the email like a html page [snip]
Sending HTML emails is somewhat of a rocket science. It is strongly
recommended that you use a library like Swift Mailer <http://
swiftmailer.org/for your HTML (and other) email needs.

--
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]

May 19 '07 #2
Ambush Commander wrote:
pa***********@g mail.com wrote:
>I want to be able to see the email like a html page [snip]

Sending HTML emails is somewhat of a rocket science. It is strongly
recommended that you use a library like Swift Mailer <http://
swiftmailer.org/for your HTML (and other) email needs.

--
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
Edward,

I have to disagree with this. Rockets aren't that complicated!

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 19 '07 #3
pa***********@g mail.com kirjoitti:
$HTML = "</html><body><img src='http://www.somewebsite .com/
someimage.jpg'> </body></html>";
the </htmlin the beginning is wrong, it should be <html>, no slash there.

--
Ra*********@gma il.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
May 19 '07 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jerry Stuckle wrote:
I have to disagree with this. Rockets aren't that complicated!
I'm not sure if you're being facetious enough, so let me expand the
metaphor. Getting a one-time rocket to work is fairly easy: the
materials are cheap and the effect usually works. It's getting things to
work consistently that causes problems. What if, now, he wants to send
multipart MIME emails (which, might I add, is recommended, as HTML
emails should have a text equivalent)?

It's also a matter of reinventing the wheel. Other people have already
figured out the whole HTML email thing out. Use their work!

- --
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGTxWFqTO +fYacSNoRAoP5AJ 9+6NEw+7iH+hrd3 v1zf6sjftUkkgCg gRz/
f43rR4F2p2tp4tV 5O1OxCRM=
=ZgjA
-----END PGP SIGNATURE-----
May 19 '07 #5
Edward Z. Yang wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jerry Stuckle wrote:
>I have to disagree with this. Rockets aren't that complicated!

I'm not sure if you're being facetious enough, so let me expand the
metaphor. Getting a one-time rocket to work is fairly easy: the
materials are cheap and the effect usually works. It's getting things to
work consistently that causes problems. What if, now, he wants to send
multipart MIME emails (which, might I add, is recommended, as HTML
emails should have a text equivalent)?

It's also a matter of reinventing the wheel. Other people have already
figured out the whole HTML email thing out. Use their work!

- --
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGTxWFqTO +fYacSNoRAoP5AJ 9+6NEw+7iH+hrd3 v1zf6sjftUkkgCg gRz/
f43rR4F2p2tp4tV 5O1OxCRM=
=ZgjA
-----END PGP SIGNATURE-----
I mean rockets aren't that hard. Not single use rockets - any rockets.

We could send men to the moon almost 25 years before we could send
mime-email - because it was much simpler.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 20 '07 #6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jerry Stuckle wrote:
I mean rockets aren't that hard. Not single use rockets - any rockets.
We could send men to the moon almost 25 years before we could send
mime-email - because it was much simpler.
Nah, that's only because the Soviet Union was pushing us back then. :-)

- --
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGT7/6qTO+fYacSNoRAt E2AJwK0yRI2NGxU FJ0FWZ7SVToc6bz MwCdHqfn
b5qKk3QGKogLobZ RvzpzV3w=
=0i/e
-----END PGP SIGNATURE-----
May 20 '07 #7

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

Similar topics

10
4199
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the DB as formatted HTML so ASP just drops them right into a page shell. Now, we want to send out a newsletter email containing some of those items. No problem sending as HTML. However, some of the members want just plain text. Is there some magic...
5
1737
by: Jim Bancroft | last post by:
Hi everyone, I receive XML documents which sometimes have HTML in the element content. When performing XSL transformations the HTML text is escaped, which affects us when we eventually display it in a browser. I understand there's a "disable-output-escaping" attribute that can be used in <xsl:value-of> elements, but is there way to do the same thing across the entire XML document, by default, without having to modify individual XSL...
2
2025
by: nadia | last post by:
Hi, I send an email from an asp.net application using the SmtpMail object. I create and HTML string and send the email in HTML MailFormat. I see the string in debug mode before the email is sent, and the string is correct. But when I receive the email and click on "view source" I see an extra whitespace + linebreak characters that was added to the html, always at position #990. In some cases it is added in a place where it doesn't make...
4
1950
by: Anand | last post by:
The situation is; I receive a response back from the server which i only a part of html code. e.g. a table like <table <tr><td>high</td></tr>........ </table>. In other words, I receive file as a response which has a part of html file. My aim is to replace an existing document node with the new response. If I run the following lines (JavaScript): var parsedText = document.createTextNode(req.responseText);
9
6738
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP page, I want to grab a URL and parse /change the HTML and send it to the JSP page. I take the URL from the user in a textbox (not the
2
1716
by: Big Moxy | last post by:
Here is my code for formatting an HTML email. I know that spinning through the $_POST array as I am isn't very pretty but it's a long list so for now I'm using this approach. The problem is that despite setting the Content-type the resulting email arrives in plain text. Outlook 2003 is my email client and I receive HTML emails without a problem. Can someone please advise me on what I'm doing wrong? $to_address = "to@mysite.com";
10
1905
by: jpollack | last post by:
I don't know JavaScript but have been tasked to write a script that will change the value of a Boolean variable to the word "Yes" on a table row. I have been trying to achieve this based on my knowledge of ActionScript. Needless to say, I have not been successful! ##CUSTOM_SUB_MARKETEYE## is a tag that pulls the Boolean result from a database. It returns 1 when it is true and null when it is false. I need to convert that "1" to the word "Yes"...
15
5283
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
10
6982
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
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...
0
10085
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
9161
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
7625
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.