• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

html formatted emails

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
jblayney
Asked:
jblayney
1 Solution
 
aolXFTCommented:
$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
 
jblayneyAuthor Commented:
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
 
jblayneyAuthor Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jblayneyAuthor Commented:
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
 
Oliver_DornaufCommented:
take a look a http:\\www.printer-friendly.com the program can send html emails.
0
 
aolXFTCommented:
There must be something wrong with the html in your message if this is happening. Try echoing it out to debug it.
0
 
jblayneyAuthor Commented:
actaully i fugured it out.. i had to add stripslashes funstion to receive it properly... tx for the help
0
 
mbeckmanCommented:
Plz close the question since you've discovered your answer. Thx.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now