usernature Posted June 29, 2007 Share Posted June 29, 2007 hello. Ive a customized simple mail script that uses the mail function to send and e-mail from a webpage form. Ive created it using this one: http://www.codetricks.com/article.php?cat=&id=11 The problem: When I see the sent email in the Microsoft Outlook , the special characters are not displayed correctly. for example the "ç" are displayed as "ç". When i see the sent email directly in gmail everithing works fine. Can anyone help-me? Thanks fred Quote Link to comment Share on other sites More sharing options...
tippy_102 Posted June 30, 2007 Share Posted June 30, 2007 Sounds like an encoding issue? What happens if you set the content type to this: Content-Type: text/html; charset=UNICODE-1-1-UTF-8 Quote Link to comment Share on other sites More sharing options...
usernature Posted June 30, 2007 Author Share Posted June 30, 2007 hello tippy! where do i write that ? "Content-Type: text/html; charset=UNICODE-1-1-UTF-8" here's my script: <?php /*Declaração de variaveis*/ $nome = $_POST['nome']; $empresa = $_POST['empresa']; $email = $_POST['email']; $mensagem = $_POST['mensagem']; //Guardar o Nome e a mensagem numa variavel: $formcontent=" enviado pos:$empresa, por:$nome\n\nMensagem: $mensagem"; $recipient = "test_mail_script@gmail.com"; $subject = "Pedido de Orcamento ou Informacoes"; $mailheader = "From: $email\r\n"; $mailheader .= "Reply-To: $email\r\n"; $mailheader .= "MIME-Version: 1.0\r\n"; //Verificar os campos obrigatórios: if((!$nome) || (!$email)){ echo '<b>Não</b> prencheu os campos obrigatórios: <br><br>'; if(!$nome){ echo " O Nome é um campo obrigatório. <a href=javascript:history.back()>volte atrás</a> e tente de novo. <br><br>"; } if(!$email){ echo "O seu e-mail é um campo obrigatório. <a href=javascript:history.back()>volte atrás</a> e tente de novo. <br><br>"; } exit(); } //enviar a mensagem mail($recipient, $subject, $formcontent, $mailheader) or die("Houve uma falha no envio da mensagem. Tente novamente e se não funcionar tente mais tarde. Pedimos desculpas pelo incomodo. <br><br>««<a href=javascript:history.back()>Tentar Novamente</a>"); echo ("A enviar! Redirecionando..."); // Texto que aparece quando está a enviar echo "<meta http-equiv='refresh' content='1; url=http://teste.teste.suc.html'>"; // Redirecciona para uma páginas depois de enviado ; ?> Quote Link to comment Share on other sites More sharing options...
tippy_102 Posted July 1, 2007 Share Posted July 1, 2007 Add it as one of the headers: $mailheader .= "Content-Type: text/html; charset=UNICODE-1-1-UTF-8\r\n"; Quote Link to comment Share on other sites More sharing options...
usernature Posted July 1, 2007 Author Share Posted July 1, 2007 HEllo again! with "$mailheader .= "Content-Type: text/html; charset=UNICODE-1-1-UTF-8\r\n";" works fine now when i use Microsoft Outlook. But now i still have a problem: When i read the message trough webmail (Horde Email Platform) the message is received as an html attachment instead of a regular e-mail. I think this can be a Horde Email plaform restriction/problem because i didnt find any option to solve that question in the configuration options. But it doesnt make sense because when I read the message trough GMAIL everything is displayed correctly. Do you have any idea of what can be the problem and what can i do to solve it? Thanks fred Quote Link to comment Share on other sites More sharing options...
tippy_102 Posted July 1, 2007 Share Posted July 1, 2007 Try changing text/html to text/plain and see if that works. Quote Link to comment Share on other sites More sharing options...
usernature Posted July 2, 2007 Author Share Posted July 2, 2007 hello tippy changing text/html to text/plain works fine in Outlook. In the webmail (Hordemail) the message is not received as an attachement that is great, but now the characters are not correct in the webmail.. Quote Link to comment Share on other sites More sharing options...
tippy_102 Posted July 4, 2007 Share Posted July 4, 2007 Drats - we're taking one step forward, and another step back. :-( I've given you everything in my bag of tricks. Hopefully someone else will jump in with the answer. Quote Link to comment Share on other sites More sharing options...
usernature Posted July 4, 2007 Author Share Posted July 4, 2007 ya..well, lets wait for some other ideias.. thank you for the support! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.