README.md

December 4, 2022 · View on GitHub

Howto send html based E-mail with php

Description

Teaches you howto send html based E-mail with php

More Info

Submitted On
ByPeter Rekdal Sunde
LevelBeginner
User Rating4.2 (25 globes from 6 users)
CompatibilityPHP 3.0, PHP 4.0
CategoryInternet/ Browsers/ HTML
WorldPHP
Archive File

Source Code

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

Pretext:
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).

Pretext
Setup
Examples
FAQ


Setup:
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.

Examples:
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.
FAQ:
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.