Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Tutorial : Sending HTML email with PHP
Old 01-19-2007, 12:57 AM Tutorial : Sending HTML email with PHP
Average Talker

Posts: 28
Trades: 0
It is basic for newbie just learning PHP.
Just a simple code to show you how to send an HTML email!

You can use to create your contact page.That ok.

PHP Code:
<?php  
// Recipients. You can send it to more than 1 person!  
$to "you1 <you@yoursite.com>" ", " // note the comma  
$to .= "you2 <you2@yoursite.com>";  

// This is the email subject  
$my_subject "My first HTML message!";  

// Message  
$my_message '  
<html>  
<head>  
<title>My first HTML message!</title>  
</head>  
<body>  
<table>  
<tr>  
<td>Hi! Just to say i can now send html mail :p</td>  
</tr>  
<tr>  
<td>Do you like it!? C ya</td>  
</tr>  
</table>  
</body>  
</html>  
'
;  

// To send HTML mail, you can set the Content-type header.  
$my_headers "MIME-Version: 1.0rn";  
$my_headers .= "Content-type: text/html; charset=iso-8859-1rn";  

// Setting additional headers  
$my_headers .= "From: HTML mail <example@example.com>rn";  

$my_headers .= "Cc: example@example.comrn";  
$my_headers .= "Bcc: example@example.comrn";  

// And now mail it!  
mail($to$my_subject$my_message$my_headers);  
?>
Any question please reply.I will answer for you.
Get more information about my code you can visit :
http://www.t4vn.net/example/showcode...TML-email.html

Thanks for reading this thread.
__________________

Please login or register to view this content. Registration is FREE
==>PHP Tutorials,PHP Example,PHP Script,Online Project,PHP News,....and more,helper coding...

Please login or register to view this content. Registration is FREE
==>Dog Information
t4vn.net is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-23-2007, 02:23 AM Re: Tutorial : Sending HTML email with PHP
Junior Talker

Posts: 4
Name: Jack
Trades: 0
very simple.
But how to add attachment in email ?.
jacken is offline
Reply With Quote
View Public Profile
 
Old 01-23-2007, 06:25 PM Re: Tutorial : Sending HTML email with PHP
Mattmaul1992's Avatar
Ultra Talker

Posts: 486
Name: Matt
Trades: -1
Do you know how attachments work? It's actually, from what I understand quite simple. Just make an upload location on the email clients server then make a link in the email that says View Attachment or Download Attachment and just make it a link to that file. Simple, huh? I might be completely wrong, but that's one way to make it work even if that's not how it's usually done.
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
Old 01-23-2007, 06:38 PM Re: Tutorial : Sending HTML email with PHP
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
To add an attachment (the correct way) learn MIME or use an already built library like...

HTML MIME Mail
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 01-24-2007, 10:00 PM Re: Tutorial : Sending HTML email with PHP
Average Talker

Posts: 28
Trades: 0
Quote:
very simple.
But how to add attachment in email ?.
==>Please read this tutorial.
http://www.t4vn.net/example/showcode...tachments.html
good luck.
__________________

Please login or register to view this content. Registration is FREE
==>PHP Tutorials,PHP Example,PHP Script,Online Project,PHP News,....and more,helper coding...

Please login or register to view this content. Registration is FREE
==>Dog Information
t4vn.net is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Tutorial : Sending HTML email with PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32035 seconds with 12 queries