emopoops Posted November 18, 2009 Share Posted November 18, 2009 im using the php mail() function to send an email and i got the email. except its formatted wrong like it looks like this: <table bgcolor="black"><tr bgcolor="#111111"><td bgcolor="#222222" width="60%" etc.. u get it right? i use gmail. now ive had images sent in mails to me. so why is this not working? i havent tested images but i figure that if table doesnt work img wont either. whats going on? is there a workaround? or is this what all mail sent by php mail() is bound to look like. i have free hosting atm. or is it the hosting? im clueless halp?! Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/ Share on other sites More sharing options...
cags Posted November 18, 2009 Share Posted November 18, 2009 Are you saying that the HTML that you wish to be in the e-mail is just appearing as plain text? If thats the case then you need to set the header of the e-mail to say it is HTML. $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=us-ascii\r\n"; Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960461 Share on other sites More sharing options...
emopoops Posted November 18, 2009 Author Share Posted November 18, 2009 ok thanks you. that is something i needed to know. ok but this is what i have so far regarding the headers. how do i exactly incorporate it into what i have already? $headers = 'From: noreply@socialemo.com' . "\r\n" . 'Reply-To: noreply@socialemo.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960478 Share on other sites More sharing options...
cags Posted November 19, 2009 Share Posted November 19, 2009 $headers = "From: noreply@socialemo.com\r\n"; $headers .= "Reply-To: noreply@socialemo.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=us-ascii\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960494 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 im sorry i dont understand why th variable is repeated over and over again and i really dont understand the space and then . Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960508 Share on other sites More sharing options...
cags Posted November 19, 2009 Share Posted November 19, 2009 $variable .= "Some value"; Means take the value of $variable and append "Some value" to the end of it. Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960522 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 nice to know. nice to know. thanks i added the headers to my script i am checking it now ill see in about an hour when the mail arives (byet free host LOL) Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960664 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 yeah thanks i got the email. is there differnt content types and charsets? Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960675 Share on other sites More sharing options...
Gayner Posted November 19, 2009 Share Posted November 19, 2009 yeah thanks i got the email. is there differnt content types and charsets? Google that broski. Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960682 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 i dont think its very fair to tell someone to google something when there is a forum where u can ask as well. im not sure its even appropriate either. dont be mean to me Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960684 Share on other sites More sharing options...
Gayner Posted November 19, 2009 Share Posted November 19, 2009 i dont think its very fair to tell someone to google something when there is a forum where u can ask as well. im not sure its even appropriate either. dont be mean to me :'( :'( :'( Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960689 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 dont make this personal nick. Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960691 Share on other sites More sharing options...
mikesta707 Posted November 19, 2009 Share Posted November 19, 2009 Its a good idea to get in the habit of googling things. You learn a lot more when you google things, because there is usually some information there that can pique your interest, which can lead you to google more things, and set of a chain of learning goodness. This forum is a place to ask questions, but generally, the topic can't be fully explained in the scope of a forum post. Tutorials are good places to learn, and books are even better. The manual can usually solve 90% of your problems also, and reading the manual is another great way to learn. Not to mention that people volunteer here to answer questions, and asking basic questions that are off topic from the original post (to a moderate extent) when the answer can be quickly gotten through google is asking a little much. Remember, Google is your friend, and will never be mean to you. Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960692 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 no ive googled it before. and i spend all day googling all the time. beleive me i know also. does anyone know why its comiing up in the to: part of the email i recieve, my email adrss twice(it doesnt do this on other emails) like to: me@blah.com, me@blah.com ?? Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960699 Share on other sites More sharing options...
cags Posted November 19, 2009 Share Posted November 19, 2009 No, since you didn't actually provide any code originally it's impossible to say. Yes there are other Content-Types that can be used. Try looking up mime types. Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-960893 Share on other sites More sharing options...
emopoops Posted November 19, 2009 Author Share Posted November 19, 2009 whatever. im using the headers. but no. ive looked up mime types i dont uderstand thats why i ask in forums thank u verry much Quote Link to comment https://forums.phpfreaks.com/topic/182070-mail-not-doing-tables-showing-code-etc/#findComment-961238 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.