•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,907 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,307 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2988 | Replies: 1
![]() |
•
•
Join Date: Apr 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
i need to use a php script to recieve an email body text from flash and send that email to a fix address with a fix subject.
i was able to do so but i got stuck with 2 problems:
1. why does a multiline text data get sended as a single line one?
2. The body text alone is in Hebrew and Hebrew ONLY... the email keeps coming in 'Jibrish'.
What can be done about these 2??
P.s.
Here is the php script i use:
<?php
$name = 'Wedding';
$email = 'june9@lycos.co.uk';
$subject = 'Confirmation';
$message=utf8_decode($HTTP_POST_VARS['message']);
$toaddress='haba97@int.gov.il';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=ISO-8859-8' . "\r\n";
mail($toaddress,$subject,$message,"From: $name <$email>", $headers);
?>
i was able to do so but i got stuck with 2 problems:
1. why does a multiline text data get sended as a single line one?
2. The body text alone is in Hebrew and Hebrew ONLY... the email keeps coming in 'Jibrish'.
What can be done about these 2??
P.s.
Here is the php script i use:
<?php
$name = 'Wedding';
$email = 'june9@lycos.co.uk';
$subject = 'Confirmation';
$message=utf8_decode($HTTP_POST_VARS['message']);
$toaddress='haba97@int.gov.il';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=ISO-8859-8' . "\r\n";
mail($toaddress,$subject,$message,"From: $name <$email>", $headers);
?>
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 4
Solved Threads: 2
•
•
•
•
1. why does a multiline text data get sended as a single line one?
Content-type: text/html;
with this instead:
Content-type: text/plain;
•
•
•
•
2. The body text alone is in Hebrew and Hebrew ONLY... the email keeps coming in 'Jibrish'.
charset=ISO-8859-8
to this:
charset=ISO-8859-1
so basically your last header line should look like this:
[php]$headers .="Content-type: text/plain; charset=ISO-8859-1\r\n"[/php]
charset=iso-8859-1
some other headers I would recommend adding are the following:
[php]$headers .= "From: ".$sender_name." <".$_POST['email'].">\r\n";
$headers .= "Reply-To: <".$sender_email.">\r\n";
$headers .= "Return-Path: <".$sender_email.">\r\n";[/php]
obviously there are other headers you could use, but it's always good to have a return path in case whomever you email decides to hit the reply button
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- mail function issue in php (PHP)
- Sending HTML email via PHP mail function (PHP)
- Problems with PHP mail function. (PHP)
- Stuck on Mail() Function (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP Confirm Delete
- Next Thread: avatar generator/maker script?


Linear Mode