Solved

html formatted emails

Posted on 2003-12-09
9
238 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
Comment Utility
$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
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:jblayney
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Expert Comment

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

Expert Comment

by:aolXFT
Comment Utility
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
Comment Utility
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
Comment Utility
Plz close the question since you've discovered your answer. Thx.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now