Solved

html formatted emails

Posted on 2003-12-09
9
239 Views
Last Modified: 2008-03-06
hello,
i am having diffuculty sending html formatted emails, The content of the email comes from a html form, I paste in the enitire code for a webpage, chnage all " to ' and write the full path name to the images on my server
( eg. <img src='http://www.websit.com/images/imagename.jpg'> )

whats happening is the the images are not displaying, and all the html formatting is messed up... this is my code

$msg = "$message\n";

$to = "$email";
$subject = "Newsletter";

$mailheaders = "From: jblayney@jrbgraphicdesign.com\n";
$mailheaders .= "Reply-To: jblayney@jrbgraphicdesign.com";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=iso-2022-jp\r\n";

mail($to,$subject,$msg,$mailheaders);


seemd weird, i though this code used to work, I've used it on other servers..

justin
0
Comment
Question by:jblayney
9 Comments
 
LVL 6

Expert Comment

by:aolXFT
ID: 9907603
$mailheaders = "From: jblayney@jrbgraphicdesign.com\n";
$mailheaders .= "Reply-To: jblayney@jrbgraphicdesign.com";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=iso-2022-jp\r\n";

I think you probably have a typo. Aren't headers supposed to be seperated by \r\n(no matter what OS you are using), Shouldn't there also be a newline, after the Reply-To header?
0
 
LVL 1

Author Comment

by:jblayney
ID: 9907674
tx,
didnt help at all, the emails i am testing with are outlook express for macintosh,, yahoo and hotmail wont even receive the email
0
 
LVL 1

Author Comment

by:jblayney
ID: 9907736
ok,
i just doscovered something, if i hard code the image into the message

$msg = "$message\n";
$msg .= "<img src ='whatever'>";

it works, but not if i send it from the form, the images are going to change, so i need them to come from the form, as well as links
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 1

Author Comment

by:jblayney
ID: 9907842
i have a thought.....(sometimes happens)

$message is coming directly from the form into the $msg, should I catch it first and convert it to a usable form...
0
 
LVL 4

Expert Comment

by:Oliver_Dornauf
ID: 9912375
take a look a http:\\www.printer-friendly.com the program can send html emails.
0
 
LVL 6

Expert Comment

by:aolXFT
ID: 9912753
There must be something wrong with the html in your message if this is happening. Try echoing it out to debug it.
0
 
LVL 1

Accepted Solution

by:
jblayney earned 0 total points
ID: 9912855
actaully i fugured it out.. i had to add stripslashes funstion to receive it properly... tx for the help
0
 
LVL 2

Expert Comment

by:mbeckman
ID: 9947057
Plz close the question since you've discovered your answer. Thx.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question