Quick Search for:  in language:    
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
PHP Stats

 Code: 70,122 lines
 Jobs: 9 postings

Sponsored by:


You are in:


Latest Code Ticker for PHP.
iif() function
By Martin C. Conniffe on 8/16

Dynamic List of Specified Files
By nothing34543534 on 8/15

Active Users (No MySQL) UPDATED! BETTER!
By Brandon Sachs on 8/15

PassGen v 1 stable
By Bogomil Shopov on 8/15

toString v 1.0 b
By Bogomil Shopov on 8/15

Calculating factorials
By Daniel Destro do Carmo on 8/14

AcidicChip's MP3 ID3v2 Tag Writer 1.0
By Chance O. One on 8/14

Click here to see a screenshot of this code!user 2 user messenger 2
By Cornelius Herzog on 8/14

(Screen Shot)

By Sven Wagener on 8/13

Click here to put this ticker on your site!

Add this ticker to your desktop!

Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites


Howto send html based E-mail with php


Submitted on: 4/2/2002 7:58:53 AM
By: Peter Rekdal Sunde  
Level: Beginner
User Rating: By 5 Users
Compatibility:PHP 3.0, PHP 4.0

Users have accessed this article 4716 times.
(About the author)
     Teaches you howto send html based E-mail with php

Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

How to send mime enchased content (html) by E-mail. (Windows/Linux/UNIX).

This howto covers how you can send html based E-mail(s) by using php.
When I started out with php, one of the first things I wanted to learn was how
to send html based (E-mail) to my friends. I’m not going to bother you with
my life experience with php, so let’s start.

Content: (what this howto covers).


When I first started programming php, I thought you needed to have many packages/software installed on your computer to run all features that comes with php.
Well you don’t, all you need is, php3, apache and a mysql engine (optional).
If you already have php and apache installed, then you can scroll down to read the rest of this howto. If you don’t got the software/packages mentioned above, then you need to install them.

I’ll skip the boring part, and I’m assuming you have some php knowledge.

You can download this file as an example.
After you've downloaded this file, you extract it into your htdocs/ folder or whatever folder you may use as your default webcontent excutable folder.
1.Does my friends/users E-mail client accept all html code?
Unfortunately, not all E-mail clients can view html code.
Ie, Microsoft Outlook 6.0 can’t view Macromedia Flash code.
But that’s another thing.

2. Can I put all kinds of html inside the body tag?
Yes, you can but remember not to have any “” (quotes) inside the $body tag.
If you’re html contains “” (quotes) you need to replace them.
Ie, $body = “"my link.php" this is my link”;
That will generate an error in the php engine.
But if you replace it with $body = “\my link.php\ this is my link”; then php engine will accept it. The current function is called (“stripslashes”);

This bad howto was written by Peter Rekdal Sunde aka Exion.
I created this howto within an 30 minutes.
I realize that it is full of “bad spellings” but I don’t care because you can still learn from it.

Other 4 submission(s) by this author


Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
Other User Comments
4/5/2002 2:11:10 AM:Bogomil Shopov
Dear Peter Rekdal Sunde, Your article is very good but the full MIME requirements is not observed. You must include the folowing lines in your code too: $headers .=
Keep the Planet clean! If this comment was disrespectful, please report it:

4/5/2002 10:24:57 AM:FASTBITS
Good code. But if this is for a beginner, please use complete html(php) code page. Thanx anyway.
Keep the Planet clean! If this comment was disrespectful, please report it:

4/5/2002 3:17:39 PM:Peter Rekdal Sunde
It's a small article that teaches the beginners how they can send html based E-mail with php, and how easy it can be done. The example i've added can send html code, php code with (eval()) and macromedia flash, and ofcourse images.
Keep the Planet clean! If this comment was disrespectful, please report it:

4/8/2002 9:20:26 AM:InteractiveWebGuys
ok so where is the howto all it says is the faq's and they don't teach you much at all
Keep the Planet clean! If this comment was disrespectful, please report it:

Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.


Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | PHP Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.