473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

HTML-eMail by PHP-Script

Hello,
i want for a newsletter to send html valid newsletters.
per adminscript i save the context which will be sent to a
mysql-database and get this data for the mail later on.
it's a pitty, but in the reciever email there is the htmlcode and not
the thing i want to show...

can anybody tell me, what's wrong on the following script?
$subject = "studio120 Newsletter vom $date";
$msg = $nl_row["msg"];

while($row = mysql_fetch_array($query))
{
$email = $row["email"];
@mail($email, $subject, $msg, "FROM: No*****@studio120.de");
}

Greetz
Manuel
Jul 17 '05 #1
5 1914
Manuel Hegemann wrote:
i want for a newsletter to send html valid newsletters. (...) while($row = mysql_fetch_array($query))
{
$email = $row["email"];
@mail($email, $subject, $msg, "FROM: No*****@studio120.de");
}


You're missing important headers for sending HTML formatted mail.
Check the headers one of the HTML messages you received to see what you
need to add.

Catch-up with the RFC 2045 (Multipurpose Internet Mail Extensions)
http://www.faqs.org/rfcs/rfc2045.html

Or use a ready-made script easily found on the internet.

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #2
Guetentag Manuel,

it misses the header information required to send HTML mail.

try this instead
$headers = "FROM: No*****@studio120.de\r\nContent-Type: text/html;
charset=iso-8859-1";
@mail($email, $subject, $msg, $headers);

Regards,

Michel
"Manuel Hegemann" <ma*************@web.de> wrote in message
news:c9*************@news.t-online.com...
Hello,
i want for a newsletter to send html valid newsletters.
per adminscript i save the context which will be sent to a
mysql-database and get this data for the mail later on.
it's a pitty, but in the reciever email there is the htmlcode and not
the thing i want to show...

can anybody tell me, what's wrong on the following script?
$subject = "studio120 Newsletter vom $date";
$msg = $nl_row["msg"];

while($row = mysql_fetch_array($query))
{
$email = $row["email"];
@mail($email, $subject, $msg, "FROM: No*****@studio120.de");
}

Greetz
Manuel

Jul 17 '05 #3
Hello,

On 06/01/2004 06:13 AM, Manuel Hegemann wrote:
Hello,
i want for a newsletter to send html valid newsletters.
per adminscript i save the context which will be sent to a
mysql-database and get this data for the mail later on.
it's a pitty, but in the reciever email there is the htmlcode and not
the thing i want to show...


If you want to send properly composed HTML messages, you may want to try
this class that simplifies the process a lot:

http://www.phpclasses.org/mimemessage
--

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 #4
Manuel Hegemann wrote:

i want for a newsletter to send html valid newsletters.


Please don't. See also: http://www.efn.no/html-bad.html

bblackmoor
2004-06-04
Jul 17 '05 #5
Hello,

Manuel Hegemann wrote:

i want for a newsletter to send html valid newsletters.


To send HTML e-mail you need to compose a MIME multipart/alternative
message that contains a text part message that is meant to be displayed
to users of e-mail programs that do not support HTML. If you do not do
this, your messages may be discarded by spam filters.

You may want to try this class to help you to compose HTML messages
properly, including embedded image and attachments if you want. Just
take a look at the examples:

http://www.phpclasses.org/mimemessage
--

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 #6

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

Similar topics

0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
9
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. ...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
6
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.