Jump to content
Fórum Script Brasil
  • 0

Função Mail


SirSmart

Question

6 answers to this question

Recommended Posts

  • 0

Eis o Codigo:

<?php
/* Destinatário */
$to  = "uil_filho@terra.com.br" . ", "; // Observe a vírgula
//$to .= "kelly@example.com";

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

/* mensagem */
$message = '
<html>
<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>
 </tr>
 <tr>
  <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
 </tr>
</table>
</body>
</html>
';

/* Atenção se você pretende inserir numa variável uma mensagem html mais
 complexa do que essa sem precisar escapar os carateres 
 necessários pode ser feito o uso da sintaxe heredoc, consulte tipos-string-sintaxe-heredoc */

/* Para enviar email HTML, você precisa definir o header Content-type. */
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* headers adicionais */
$headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";

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

/* Enviar o email */
mail($to, $subject, $message, $headers);

?> 

Até mais

Link to comment
Share on other sites

  • 0

Não sei se vai funcionar, mas tenta ai depois me fala

<?php

/* Destinatário */

$to = "uil_filho@terra.com.br"; // Observe a vírgula

//$to .= "kelly@example.com";

/* assunto */

$subject = "Birthday Reminders for August";

/* mensagem */

$message = '

<html>

<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>

</tr>

<tr>

<td>Sally</td><td>17th</td><td>August</td><td>1973</td>

</tr>

</table>

</body>

</html>

';

/* Atenção se você pretende inserir numa variável uma mensagem html mais

complexa do que essa sem precisar escapar os carateres

necessários pode ser feito o uso da sintaxe heredoc, consulte tipos-string-sintaxe-heredoc */

/* Para enviar email HTML, você precisa definir o header Content-type. */

$headers = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* headers adicionais */

$headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n";

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

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

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

/* Enviar o email */

mail($to, $subject, $message, $headers);

?>

Link to comment
Share on other sites

  • 0
Guest - manu -

Pega o arquivo php.ini dentro da pasta php, procura onde tem o sendmail_from e apaga o ponto e vírgula que tiver antes dele. Salva, fecha tudo e abre novamente pra ver se dá certo.

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
Answer this question...

×   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.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...