Jump to content


WeeD's Content

There have been 103 items by WeeD (Search limited from 06/06/2023)



Ordernar por                Order  

#664021 Enviar Email Com Axexo

Posted by WeeD on 23/11/2005, 15:12 in PHP

ae fazendo favor, alguem pode me falar porque não esta indo o anexo junto ? tipo o email chega normal no destino mas sem anexo!

<?php
  $acao = $_GET["acao"];
  if ($acao == "enviar") {
      $nome      = $_POST["NOME"];
      $assunto   = $_POST["ASSUNTO"];
      $remetente = $_POST["EMAIL"];
      $destino   = $_POST["OPCOES"];
      $mensagem  = $_POST["TEXTO"];

      $mensagem  = wordwrap($mensagem,50,"<br>",1);

      $arquivo   = isset($_FILES["ARQUIVO"]) ? $_FILES["ARQUIVO"] : FALSE;

      if (file_exists($arquivo["tmp_name"]) and !empty($arquivo)) {
          $fp    = fopen($_FILES["ARQUIVO"]["tmp_name"],"rb");
          $anexo = fread($fp,filesize($_FILES["ARQUIVO"]["tmp_name"]));
          $anexo = base64_encode($anexo);

          fclose($fp);

          $anexo    = chunk_split($anexo);
          $boundary = "XYZ-" . date("dmYis") . "-ZYX";

          $texto    = "--$boundary\n";
          $texto   .= "Content-Transfer-Encoding: 8bits\n";
          $texto   .= "Content-Type: text/html; charset=\"ISO-8859-1\"\n\n";
          $texto   .= "$mensagem\n";
          $texto   .= "--$boundary\n";
          $texto   .= "Content-Type: ".$arquivo["type"]."\n";
          $texto   .= "Content-Disposition: attachment; filename=\"".$arquivo["name"]."\"\n";
          $texto   .= "Content-Transfer-Encoding: base64\n\n";
          $texto   .= "$anexo\n";
          $texto   .= "--$boundary--\r\n";

          $headers  = "MIME-Version: 1.0\n";
          $headers .= "From: \"$nome\" <$remetente>\r\n";
          $headers .= "Content-type: multipart/mixed; boundary=\"$boundary\"\r\n";
          $headers .= "$boundary\n";

          $Enviar=mail($destino,$assunto,$texto,$headers);

          echo"Email enviado com Sucesso!";
      }
      else {
           $headers  = "MIME-Version: 1.0\r\n";
           $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
           $headers .= "From: \"$nome\" <$remetente>\r\n";

           $Enviar=mail($destino,$assunto,$mensagem,$headers);

           echo"Email enviado com Sucesso!";
      }
  }
?>

Obriagdo!



#498854 Pessoal Me Ajudem!

Posted by WeeD on 10/12/2004, 22:35 in ASP

nossa se tem coragem em colocar response.write em tudo isso ai :)
mas tipo tenta assim onde tem & dentro dos response.write.

Response.Write "&rs.fields('95')" = Response.Write " "&rs.fields('95')" " sei lá só pra ver mesmo :)



#500366 Me Ajudem !

Posted by WeeD on 13/12/2004, 23:10 in ASP

Bom se você ta usando cookies pra gravar a senha e o email, usuario, num sei é +/-:
verifica se o use ta logado e tal.
<%
logado = request.cookies("NOMECOOKIES")
if logado <> "true" then
response.Redirect("pagina.asp")
end if
%>
<%
useremail = request.cookies("nomedocookies")
sql = "select * from NOMETABELA where email = '"&request.cookies("NOMECOOKIES")&"'"
rs.open sql,conexao,3,3
senha = rs("senha")
email = rs("email")
%>
<input name="senha" type="text" value="<%=senha%>">
<input name="senha" type="text" value="<%=email%>">

ai é só usar ao invez de "INSERT" usar um "UPDATE"
sql = "update NOMETABELA set senha='"&senha&"', nome='"&email&"' WHERE usermail = '"&usermail"'

bom é +/- isso ai, agora mãos a obra




IPB Skin By Virteq