Alguém sabe?

Enviada por Nelson 
Nelson
Alguém sabe?
26 de November de 2001 às 08:39PM
Oi,

Configurei um script, ajustei algumas coisas nele, mas não entendo o que está acontecendo aqui. O código:

# Predefine the Mail Settings for sending...
$mailheaders = "From: $youremail\n";
$mailheaders .= "Reply-To: $youremail\n";
$mailheaders .= "Return-Path: $youremail\n";

# add data in bcc fields

# Data was ok, send button is pressed
if ($send == "yes"){
$message=stripslashes($message);
$subject=stripslashes($subject);
$lines = explode("%",$content);
for ($key=1;$key<sizeof($lines);$key++){
mail ($lines[$key],$subject,$message,$mailheaders);
}
print "<b>The following email has been sent!</b>";
print "<pre>$mailheaders\n$subject\n$message</pre>";
}
}
----- Ele pega os %email@email.com da lista e envia uma mensagem para cada. Mas ele está enviando sem o from: e subject:. E está inserindo estar informações no body na mensagem.
Assim:



Subject: Este é o subject
From: lista@sitecom.com.br
Reply-To: lista@sitecom.com.br
Return-Path: lista@sitecom.com.br


Este é o corpo da mensagem



-
nobody
Re: Alguém sabe?
27 de November de 2001 às 02:29PM
opa,
veja este exemplo retirado do site www.php.net
http://www.php.net/manual/en/function.mail.php

/* recipients */
$to = "Mary <mary@example.com>" . ", " ; //note the comma
$to .= "Kelly <kelly@example.com>";

/* subject */
$subject = "Birthday Reminders for August";

/* message */
$message = '

<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>

';

/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";

$headers .= "Cc: birthdayarchive@example.com\r\n";
$headers .= "Bcc: birthdaycheck@example.com\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers


Abraço,
André de Castro Zorzo
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.