473,657 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send an email with HTML

Hello.

Is it possible to send an email with some HTML code ?

I tried the following code, where $msg == '<html><body>.. . blah blab
blah etc.</body></html>' :

// Adresse de l'expediteur
$entete = "From: $from \n";

// Copie du message
$entete .= "Cc: $cc \n";

// Copie cachée
$entete .= "Bcc: $bcc \n";

// Adresse de réponse
$entete .= "Reply-To: $from \n";
$entete .= 'X-Mailer: PHP/' . phpversion() . '\n';

// On peut ajouter ses propres en-tête
$entete .= 'X-CeQueVousVoulez : Contact EASYJOKE \n';

// Type MIME
$entete .= 'Content-Type: text/plain; charset=iso-8859-1 \n';

// Encodage
$entete .= 'Content-Transfer-Encoding: 8bit \n';

mail($to, $subject, $msg, $entete);
Any help would be welcome...
Thx Titi

Oct 27 '05 #1
5 2328
Thierry (ab***@microsof t.com) wrote:
: Hello.

: Is it possible to send an email with some HTML code ?

The header of the mail message needs "Content-type: text/html"

Of course you understand that that header is also used by many mail
filters to reject unwanted mail.
--

This programmer available for rent.
Oct 27 '05 #2
Malcolm Dew-Jones a écrit :
Thierry (ab***@microsof t.com) wrote:
: Hello.

: Is it possible to send an email with some HTML code ?

The header of the mail message needs "Content-type: text/html"

Of course you understand that that header is also used by many mail
filters to reject unwanted mail.

But I need something that will not be rejected :-(

Oct 27 '05 #3
Thierry (ab***@microsof t.com) wrote:
: Malcolm Dew-Jones a écrit :
: > Thierry (ab***@microsof t.com) wrote:
: > : Hello.
: >
: > : Is it possible to send an email with some HTML code ?
: >
: > The header of the mail message needs "Content-type: text/html"
: >
: > Of course you understand that that header is also used by many mail
: > filters to reject unwanted mail.
: But I need something that will not be rejected :-(

I forgot to add, you also need "MIME-Version: 1.0" in the header.

If you send html mail then people who reject html mail will reject it. I
don't know what percentage that is, but I think it is non trivial though
well less than the majority.

If you don't want them to reject your mail then send text instead.

Spam filters will typically increase the spam rating for html mail, which
may or may not cause it to be rejected. More people (%-wise) use spam
filters than those that simply reject html mail, it may well be the
majority now.

If you don't want a spam filter to reject your mail then be careful not to
send spam, or things that look like spam. Be careful to stay off various
blocking lists, and don't send large volumes of similar looking mail
unless it's a bona fide sign-up mail list.
--

This programmer available for rent.
Oct 27 '05 #4
Thierry <ab***@microsof t.com> wrote:
Malcolm Dew-Jones a écrit :
Thierry (ab***@microsof t.com) wrote:
: Hello.

: Is it possible to send an email with some HTML code ?

The header of the mail message needs "Content-type: text/html"

Of course you understand that that header is also used by many mail
filters to reject unwanted mail.


But I need something that will not be rejected :-(


"Many" is an exaggeration. A few zealots do reject mail that is HTML-only.

The more acceptable method is to include both an HTML part and a plain
part.

Subject: This is my message
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="____s eparator____"

This section is only read by mail readers that do not understand MIME.

--____separator__ __
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

This is the plain text section.

--____separator__ __
Content-Type: text/html
Content-Transfer-Encoding: 8bit

<html><body><h1 >This is the <i>HTML</i> section.</h1></body></html>

--____separator__ __--
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 29 '05 #5
Message-ID: <57************ *************** *****@4ax.com> from Tim
Roberts contained the following:
"Many" is an exaggeration. A few zealots do reject mail that is HTML-only.


I reject it and I wouldn't call myself a zealot. I had a mail today
saying I had received a postcard from a family member. It contained the
following lines:
....
<p align="left"><f ont size="2" face="Arial"><A
href="http://sex.idilis.ro/postcard.exe"
target=_blank>h ttp://www2.postcards. org/?a91-valets-cloud-31337</A></font></p>
....

Says it all really.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Oct 30 '05 #6

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

Similar topics

11
12076
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
1
1871
by: Kenshin | last post by:
Hey! I have another script where i pull all the information from the database and I want to send it to the person. What they do is they enter in their email, and if the email matches, than it will email them their login information. How do you grab the info and than use that info and put it into an email to send? Here is my code thus far for it:
6
11175
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
2
5258
by: David Lozzi | last post by:
Howdy, I'm new to .Net 2.0... Getting "System.Net.Mail.SmtpException: The operation has timed out" on this script at the smtpClient.Send(msg) line Dim msg As New MailMessage
2
5630
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not support .asp,.aspx files, it supports PHP files, I'm searching in JavaScript ,but not found any matter, I'don't Know PHP.I'm having lot of pressure of higer officials.Please help me on this.
2
2479
by: kennykenn | last post by:
Hi, Ive producd code to send an email after capturing info off a form,it works fine locally but when i put it live it doesnt work! the code is stopin at 'msg.send' any ideas, here the code! <%
6
5933
by: =?Utf-8?B?TMOhemFybw==?= | last post by:
Hi everyone I've a simple ASP.NET Page that send a email using smtclient. The server is a Exchange and use my credentials to autentificated. The problem is that the send mail appear in the junk email folder. Any idea. Thanks
3
100026
digicrowd
by: digicrowd | last post by:
http://bytes.com/images/howtos/applemail_sig_icon.jpg You can make your emails fancy in Mail.app by using Rich Text formatting or even included Stationery. But, a simple way to send your own HTML creation (or any web page for that matter) is to use Safari. Follow these four easy steps. 1. Create the HTML Layout your HTML code including any images or graphics you'd like to include. In this example, we will make a simple birthday email to add...
2
18167
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
2
1827
by: urbanedge | last post by:
I've just acquired a site and uploaded to godaddy and the email function won't work. I'm new to php and I'm not able to determine where the issue is. I've commented out $this->header .= $this->body; and I get a blank email to send. I've stripped down the body file but there still seems to be a problem. I'm not sure where to look now. This is the body file. <?php /******************** EMAIL ***************************/ $sRuta =...
0
8421
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
8325
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
8844
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
8742
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
6177
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
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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...
1
2743
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
1971
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.