Jump to content

Dúvida com o mail em php!


charly
 Share

Recommended Posts

Boas a todos, eu estou agora a preparar um campeonato de CS 1.6, onde os pagamentos serão feitos por sms, e depois a pagina redirecciona para uma página de inscrição.

www.nexusystem.site11.com

esta página terá um botão chamado enviar, que chamará  mail.php com o seguinte código:

<?php
$a="admin.nexusystem@sapo.pt";
$subject="Email de Teste";
$message="Olá! Esta é um simples mensagem de email";
$from="cs_dog@hotmail.com";
$headers="From: $from";
mail ($a, $subject, $message, $headers);
echo "email enviado!";
?>

Segundo as informações que tenho, a variável $message, pode ter 70 caracteres por linha, eu gostaria de saber quantas linhas pode conter esta variável.

Link to comment
Share on other sites

Teoricamente, o único limite é aquele que o teu servidor SMTP te puser. O do GMail é de 20MB, o que dá para uns bons milhares de caracteres.

Mas nada como testar: file_get_contents() de um ficheiro de texto grande, guardas na $message e mandas 🙂

❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Link to comment
Share on other sites

Citando a php.net @ http://pt.php.net/manual/en/function.mail.php

message

Message to be sent.

Each line should be separated with a LF (\n). Lines should not be larger than 70 characters.

Caution

(Windows only) When PHP is talking to a SMTP server directly, if a full stop is found on the start of a line, it is removed. To counter-act this, replace these occurrences with a double dot.

<?php

$text = str_replace("\n.", "\n..", $text);

?>

Ou seja, nao é o limite imposto pelo SMTP, é o limite imposto pela função 😛

--------------

De qualquer forma, eu recomendo-te o uso de classes de terceiros para o envio de e-mails. Eis algumas classes:

- PHPmailer @ http://phpmailer.worxware.com/index.php?pg=examples

- SwiftMailer @ http://swiftmailer.org/

Abraço 🙂

Link to comment
Share on other sites

Segundo as informações que tenho, a variável $message, pode ter 70 caracteres por linha, eu gostaria de saber quantas linhas pode conter esta variável.

@mAiN_iNfEcTiOn:

Onde é que está o número máximo de linhas na variável nessa documentação? Isso só fala dos caracteres por linha, que o charly já sabia serem 70.

❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents

A list  of command line apps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.