Jump to content
php.lv forumi

Kā parezi nosūtīt epastus vairākiem saņēmējiem


fjckls

Recommended Posts

Man ir Flash lapa no kuras es suutu mainiigos uz php skriptu, kas nosuuta epastus 5ciem cilveekiem. Kaa parezi encodeet php, lai sanjeemeejam raadiitos pareizie vinja valodas burti. Lapa ir 6aas valodaas. Sheit ir mans php skripts:

<?php
$to = $_POST['to'];
$subject = $_POST['subject'];
$name = $_POST['name'];
$theEmail = $_POST['email'];
$message = $_POST['message'];



$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: " . $name . " " . $theEmail . "\r\n";
$headers .= "Reply-To: " . $theEmail .  "\r\n";
$headers .= "Bcc: " . $to .  "\r\n";

if(@mail('', $subject, $message, $headers))
{
echo "answer=ok";
} 
else 
{
echo "answer=error";
}

?>

Link to comment
Share on other sites

Aha paldies, obligaati nochekoshu PHPMailer .....

 

un pie reizes veel viens jautaajums - es uz servera apdeitoju csv failu ar mainiigajiem, kas arii naak no taas flash lapas shaadi:

$File = "stats.csv"; 
$Handle = fopen($File, 'a');
$sender = $_POST['sender'];
$receivers = $_POST['receivers'];
$Data = $name . " - " . $theEmail . ",". $receps. "," . $date . "\n";

fwrite($Handle, $Data); 
fclose($Handle); 

 

Kad meegjinu ieimporteet csv failu ieksh excell - visi ne anglju burti raadaas kjeburaini - laikam vajag kaut kaa encodeet...

 

@indoom - vai var liidziigi enkodeet kaa tu ieteici?

 

$subject = '=?utf-8?B?'.base64_encode($subject).'?=';

 

taapat

 

$File = "stats.csv"; 
$Handle = fopen($File, 'a');
$sender = $_POST['sender'];
$receivers = $_POST['receivers'];
$Data = $name . " - " . $theEmail . ",". $receps. "," . $date . "\n";
$Data = '=?utf-8?B?'.base64_encode($subject).'?=';
fwrite($Handle, $Data); 
fclose($Handle); 

 

paldies.....

Link to comment
Share on other sites

nu tā kodēšana vajadzīga tikai emailiem, lai subjektos rādītos utf8 teksts, citādi tur būs ķeburi, neatkarīgi no charseta.

Nedomāju, ka ekseļa gadījumā tas ir pielietojams, tur jāskatās cits risinājums.

Edited by indoom
Link to comment
Share on other sites

nu tā kodēšana vajadzīga tikai emailiem, lai subjektos rādītos utf8 teksts, citādi tur būs ķeburi, neatkarīgi no charseta.

 

un kaa tikt galaa ar to csv? .... vai var dariit liidziigi - nokodeet tos visus datus, lai raadiitos pareizie burti - krievu, vaacu, lv u.tml.

 

plds!

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...