plodos Posted February 19, 2008 Share Posted February 19, 2008 this code is a little easy to understand... but problem is same, mixing the HTML codes and Variables... for example like that -> http://img405.imageshack.us/img405/9733/testrs6.jpg Have u any idea, for this code!!!!! why its mixing and solution way?_????? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> </head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <body> <?php $name = "xxx"; $surname = "yyy"; $to="[email protected]"; $aut_email="[email protected]"; $headers = "From: $aut_email \n"; $message= ' <table width="522" height="235" border="1"> <tr> <td width="105" height="23" bgcolor="#CCCCCC">Name Surname </td> <td width="403" bgcolor="#CCCCCC">'.$name.' '.$surname.'</td> </tr> </table>'; if(mail($to, $title,$message,$headers)) echo "send"; else "not send" ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/ Share on other sites More sharing options...
Chris92 Posted February 19, 2008 Share Posted February 19, 2008 Why don't you use doubble quotations? $message= " <table width=\"522\" height=\"235\" border=\"1\"> <tr> <td width=\"105\" height=\"23\" bgcolor=\"#CCCCCC\">Name Surname </td> <td width=\"403\" bgcolor=\"#CCCCCC\">$name $surname</td> </tr> </table>"; Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470878 Share on other sites More sharing options...
plodos Posted February 19, 2008 Author Share Posted February 19, 2008 like that <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> </head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <body> <?php $name = "xxx"; $to="[email protected]"; $aut_email="[email protected]"; $headers = "From: $aut_email \n"; $message= " <table width=\"522\" height=\"235\" border=\"1\"> <tr> <td width=\"105\" height=\"23\" bgcolor=\"#CCCCCC\">Name Surname </td> <td width=\"403\" bgcolor=\"#CCCCCC\">$name</td> </tr> </table>"; if(mail($to, $title,$message,$headers)) echo "send"; else "not send" ?> </body> </html> in my opinion, you didnt test it...It is not working Another way? Problem is same still mixing the code????????????????? Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470916 Share on other sites More sharing options...
Dragen Posted February 19, 2008 Share Posted February 19, 2008 where are you setting the mime version of the email? Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470925 Share on other sites More sharing options...
rhodesa Posted February 19, 2008 Share Posted February 19, 2008 Are you trying to say that it's not showing up as an HTML email? You need to have the content-type specified in the headers to tell the email client it's HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> </head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <body> <?php $name = "xxx"; $surname = "yyy"; $to="[email protected]"; $aut_email="[email protected]"; $title = "This is my title"; //You never specify a title, I added this one for you $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: $to\r\n"; $headers .= "From: $aut_email\r\n"; $message= ' <table width="522" height="235" border="1"> <tr> <td width="105" height="23" bgcolor="#CCCCCC">Name Surname </td> <td width="403" bgcolor="#CCCCCC">'.$name.' '.$surname.'</td> </tr> </table>'; if(mail($to, $title,$message,$headers)) echo "send"; else "not send" ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470926 Share on other sites More sharing options...
plodos Posted February 19, 2008 Author Share Posted February 19, 2008 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> </head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <body> <?php $name = "xxx"; $surname = "yyy"; $to="[email protected]"; $aut_email="[email protected]"; $headers = "From: $aut_email \n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-9' . "\n"; $message= ' <table width="522" height="235" border="1"> <tr> <td width="105" height="23" bgcolor="#CCCCCC">Name Surname </td> <td width="403" bgcolor="#CCCCCC">'.$name.' '.$surname.'</td> </tr> </table>'; if(mail($to, $title,$message,$headers)) echo "send"; else "not send" ?> </body> </html> i put the mime, but it is not working I dont know how many methods i applied I didnt solve this problem? Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470928 Share on other sites More sharing options...
plodos Posted February 19, 2008 Author Share Posted February 19, 2008 ok, i did it... rhodesa's code is working clearly..thnx Link to comment https://forums.phpfreaks.com/topic/91950-php-email-simple-form/#findComment-470934 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.