View Full Version : Need help ?
kaali
08-02-2006, 04:14 PM
Hello!
I'm using php mail sender script, I have integrated it with RICH TEXT EDITOR
but the mail is not sending in HTML, Can anyone do modify script for me.
( So mail will be sent in HTML ).
Here is the link:
http://www.filecabin.com/up1/1154095144-rteanmail.zip
Please Modify the Script,
I have tried it but failed.
KAALI :confused:
djr33
08-03-2006, 01:32 AM
It has nothing to do with the script, and everything to do with the mail headers that are sent.
Special instructions ("mail headers") are added to the beginning of email messages that should be in html.
You probably can't do it if you're using a free script on another site.
If you're using the script yourself, which it sounds like you are, look into the documentation on php.net about sending emails and/or google "mail headers".
It's not the script... it's the format of the email. That should fix it.
(The one other thing is if it's sending it as html coded html... meaning you have the CODE for <, and not the character "<". Either way, though, you'll need the right headers.)
The header in question is:
Content-Type: text/html
kaali
08-04-2006, 12:52 PM
Hello!
In the Orignal Script it was:
Content-Type: text/plain
I Have changed it into :Content-Type: text/html
......... Because I want to send mail in HTML .....
:( :( I dont know php ..... :( :(
Then you should now be able to send HTML email. :)
kaali
08-05-2006, 09:29 AM
Then you should now be able to send HTML email. :)
HOW ?
If you've added that header, you can send it in the same way you'd send plain-text email, but mix HTML tags in.
kaali
08-06-2006, 11:35 AM
If you've added that header, you can send it in the same way you'd send plain-text email, but mix HTML tags in.
The above files have that header. But if i send HTML mail it displays
mail in simple text.
Have you downloaded & tested the files?
kaali
08-23-2006, 07:03 PM
please reply TWEY where are you ????????
blm126
08-23-2006, 07:50 PM
:( :( I dont know php ..... :( :(
There's your first problem. I suggest you learn a little PHP.
kaali
08-24-2006, 06:51 AM
Hello!
I know very little bittle about php, its very difficult to learn all ...
What i know, you give me the code, i can install it ......... please help
...........................
blm126
08-24-2006, 12:31 PM
*sigh* Try this for mail.php
<html>
<head>
<title> Sending Email </title>
</head>
<body>
<?php
// Read POST request params into global vars
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// Obtain file upload vars
$fileatt = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type'];
$fileatt_name = $_FILES['fileatt']['name'];
$headers = "From: $from";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
}
// Send the message
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
echo "<p>Mail sent</p>";
} else {
echo "<p>Mail could not be sent. Sorry!</p>";
}
?>
</body>
</html>
kaali
08-25-2006, 10:42 AM
Hello!
I've tested the above code, mail is sending but not in html (what i want).
preview of mail is like this:
here\'s the \"<em>preloaded</em> <b>content</b>\"
it is not displaying in html in the mail.
Twey give me following code:
<html>
<head>
<title> Sending Email </title>
</head>
<body>
<?php
// Read POST request params into global vars
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// Obtain file upload vars
$fileatt = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type'];
$fileatt_name = $_FILES['fileatt']['name'];
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; ";
$headers .= "charset=iso-8859-1\r\n";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: html/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
}
// Send the message
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
echo "<p>Mail sent</p>";
} else {
echo "<p>Mail could not be sent. Sorry!</p>";
}
?>
</body>
</html>
& asked me to striplashes it to send mail html, & i don't how to strip slashes it. I've asked him but he is not repyling.
Please can you solve this.
I shall be very thankful to you.
n Thanks alot for replying
Kaali
codeexploiter
08-25-2006, 10:52 AM
In PHP there is a function - stripslash() that returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\).
I've tested the above code, mail is sending but not in html (what i want).
preview of mail is like this:
here\'s the \"<em>preloaded</em> <b>content</b>\"
If you perform a stripslash operation on the above mentioned string which is a part of your PHP code all the back slashes will be removed
Plz checkout PHP manual if you are having any doubts about stripslash().
kaali
08-25-2006, 11:16 AM
:( Hello!
I've already said! i dont know how do this, I want ready code, just install & run ...
I'm sorry ! im disturbing you alllll .....
this my dream ...............
I wish it come true, but im not seeting to come true ..
please help
bye & take care
thanks for excellent Super B support ..
Kaali
blm126
08-25-2006, 03:44 PM
<html>
<head>
<title> Sending Email </title>
</head>
<body>
<?php
// Read POST request params into global vars
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// Obtain file upload vars
$fileatt = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type'];
$fileatt_name = $_FILES['fileatt']['name'];
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; ";
$headers .= "charset=iso-8859-1\r\n";
if (is_uploaded_file($fileatt)) {
// Read the file to be attached ('rb' = read binary)
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: html/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
// Base64 encode the file data
$data = chunk_split(base64_encode($data));
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
}
// Send the message
$ok = @mail($to, $subject, stripslashes($message), $headers);
if ($ok) {
echo "<p>Mail sent</p>";
} else {
echo "<p>Mail could not be sent. Sorry!</p>";
}
?>
</body>
</html>
The reason people aren't responding is because you are more interested in us doing it for you than learning how yourself.
kaali
08-26-2006, 08:03 PM
HellO!
I love you : blm126 : & also TWEY without you both this was not possible ...... I luv you alllllllll ......
:)
The mail is going in HTML ... WOW Unbeleiveable ...... you all ROCK ...
http://img169.imageshack.us/img169/3981/superbjl9.jpg
* the senders name is not coming instead its email address coming, hm ...*
thanks alotttttt .. luv you
bye n take care
Have a nice day!
KAALI
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.