SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 16th, 2004, 02:01 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 116 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 49 sec
Reputation Power: 5
sending email with html content

Hi guys,

I am trying to use html code as content of the email i sending out by using php but why the email my friends received are all in text format ???

what should i do to make my html code works in an email... i have created a html file and want to send it out as newsletter.. what i did is copy all the html code from the file and paste it as value for $contents but this doesn't seem to work.,,

please advise what i suppose to do,, is it i missed some header ??


Code:
// connect to db code.. 

$to = "{$row['email']}\r\n";
//$from= "From: $name < $email >\r\n";
$from= "From: testing while< myemail >\r\n";
$subject ="$subject\r\n";

if($mailtype != "html")
			{
	$MailText = stripslashes($MailText);
			}

$contents ="$MailText";

mail($to,$subject,$contents,$from);

Reply With Quote
  #2  
Old June 16th, 2004, 04:34 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 116 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 49 sec
Reputation Power: 5
Hi guys,

now it can shows the html page after i added the headers (after refer to complex email part from php.net)..

i have another problems now.. i am wondering why when i viewed the email, the html page displayed on my mailbox looks different from the online version ???
problem i encountered :
- some part of the page colors are different from the online page.,. for instance, a cell suppose to be yellow color but it displayed green in my mailbox
- some of the textfield contain unwanted values such as \"submit \", \"login\" and etc.. the textfields value should be empty but how come there are values with slashes there ??

when i add stripslashes function for my content, i would not able to view the html page (only text displayed),, but if i dun add this function, i am not able to view the proper html page..

please advise what i suppose to do,, thanks.

Code:
$from= "From: testing while< myemail >\r\n";
$subject ="$subject\r\n";

if($mailtype != "html")
			{
	$contents = stripslashes($MailText);
			}
else 
			{
$contents ="$MailText";
$from .= "MIME-Version: 1.0\r\n";
$from .= "Content-type: text/html; charset=iso-8859-1\r\n";
			}

$contents.="
============================================
Please visit http://testing.com to unsubscribe from the mailing list. Thank you. 
============================================";

mail($to,$subject,$contents,$from);
if(mail)
			{
	echo ' email is sent to :';
	echo "<br>".$row['email']."<br>";
			}
		}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > sending email with html content


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway