Jump to content

php email simple form


plodos

Recommended Posts

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

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

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

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

<!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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.