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="bbb@bbb.com";
$aut_email="xxx@xxx.com";
$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
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
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="boraardil@gmail.com";
$aut_email="xxx@xxx.com";
$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
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="bbb@bbb.com";
$aut_email="xxx@xxx.com";
$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
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="bbb@bbb.com";
$aut_email="xxx@xxx.com";

$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.