Mailing form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jslick
Forum Commoner
Posts: 35
Joined: Wed Jul 21, 2004 11:18 am

Mailing form

Post by jslick »

I have been using the same contact form for quite a while now. But I can't figure out to use HTML with it. So, I guess my question would be how do you mail an HTML email using PHP?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

generally, setting content-type in the headers sent to the mail function
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

read the comments on the mail() manual entry at php.net
http://us4.php.net/manual/en/ref.mail.php

I think that should help. You'll see what feyd is talking about.
jslick
Forum Commoner
Posts: 35
Joined: Wed Jul 21, 2004 11:18 am

Post by jslick »

Thanks, I got it working.

Really, really stupid question: How do you count how many bytes are in a variable?

(I wrote this in the same thread because it is related to the same script)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]strlen[/php_man]() if it's a string..
jslick
Forum Commoner
Posts: 35
Joined: Wed Jul 21, 2004 11:18 am

Post by jslick »

feyd wrote:[php_man]strlen[/php_man]() if it's a string..
Thanks again, feyd.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

If you cast an int as a string and then run it through strlen() do you get a correct byte count?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

for the number of digits in the integer yes.. for the number of bytes that integer used originally, no. However, the original int most likely took 8 bytes, as php supports up to 64-bit ints. Although the actual byte usage may vary, depending on how php optimizes it for memory..
Post Reply