Orkut Gmail Agenda Docs Web mais »
Grupos visitados recentemente | Ajuda | Acessar
Página inicial dos Grupos do Google
Mensagem sobre o tópico Ajuda!! Envio de email com anexo

Visualizar analisado - Mostrar apenas o texto da mensagem ??

Received: by 10.90.92.14 with SMTP id p14mr1603206agb.18.1210872175372;
        Thu, 15 May 2008 10:22:55 -0700 (PDT)
Return-Path: <rafael.infoc...@gmail.com>
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155])
        by mx.google.com with ESMTP id 22si22263835yxr.2.2008.05.15.10.22.53;
        Thu, 15 May 2008 10:22:55 -0700 (PDT)
Received-SPF: pass (google.com: domain of rafael.infoc...@gmail.com designates 72.14.220.155 as permitted sender) client-ip=72.14.220.155;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of rafael.infoc...@gmail.com designates 72.14.220.155 as permitted sender) smtp.mail=rafael.infoc...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by fg-out-1718.google.com with SMTP id l27so405251fgb.21
        for <listaphp@googlegroups.com>; Thu, 15 May 2008 10:22:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references;
        bh=RwRxlY+YK/w8G1HjVHU0hfs1bSicaiX6qJcWipmdCNY=;
        b=KGkuSl/W4WifF31nPoGX/fje/aNSqgI8xMSb9jDhZd9//WeEbEWFX/PmWFsPclo3txMoZIeMvjSYhpT+usLqWQ4BNgbW823iQCITxRPNg634YsGZa6A68Z3LbOjozO3EgYJ+blATKXxPW1tsO2v8QKaPw4zBLDUZfaS9WIgJ3J8=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references;
        b=v8+lfF4XrGddj2CtjbC4tLaxeAHAqDaSUMoIvcStoGBkZxIdAuuRSmkDl9FD5APmGR1f3BGe57b2EHEpjJ4EgQXg22Q5e7KkZIcDLjw5gquL3AbNA4IgaTETwrLGpqhiEimMHm/Bs67ds6F/4y+NzeEWvF73FfGI7BvwVZj+lUY=
Received: by 10.82.105.1 with SMTP id d1mr376618buc.26.1210872173238;
        Thu, 15 May 2008 10:22:53 -0700 (PDT)
Received: by 10.82.124.14 with HTTP; Thu, 15 May 2008 10:22:53 -0700 (PDT)
Message-ID: <5c6db75a0805151022x2c5a049du3f5472b9a82177f7@mail.gmail.com>
Date: Thu, 15 May 2008 14:22:53 -0300
From: "Rafael Vale" <rafael.infoc...@gmail.com>
Reply-To: raf...@infoccus.com.br
To: listaphp@googlegroups.com
Subject: Re: [ PHP - Google ] Ajuda!! Envio de email com anexo
In-Reply-To: <90b7a277-96ad-4eaf-90c9-e282fb4ef...@59g2000hsb.googlegroups.com>
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_Part_4298_3045178.1210872173250"
References: <90b7a277-96ad-4eaf-90c9-e282fb4ef...@59g2000hsb.googlegroups.com>

------=_Part_4298_3045178.1210872173250
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

s=F3 uma id=E9ia:

http://phpmailer.codeworxtech.com/

On Thu, May 15, 2008 at 2:16 PM, Vitor de Oliveira <vito...@gmail.com>
wrote:

>
> Esse meu codigo de envio de email com anexo esta funcionando mas o
> anexo nao aparece com a extens=E3o correta aparece . dat e o correto
> seria .pdf
>
> Segue abaixo o codigo
>
> <?php                   $from =3D "cont...@webforte.com.br";
>                        $to =3D "vitor.carva...@hcscomp.com.br";
>                        $body =3D "Corpo do email";
>                        $subject =3D "Assunto do email";
>
>
>
>                                $mailheaders =3D "From: $from\n";
>                                $mailheaders .=3D "X-Mailer: Script para
> enviar arquivo atachado\n";
>
>                                $msg_body =3D stripslashes($body);
>
>                                $attach =3D "xml_xsl.pdf";
>                                $attach_size =3D filesize($attach);
>                                $attach_name =3D "xml_xsl";
>                                $attach_type =3D filetype($attach);
>
>
>                                $file =3D fopen($attach, "r");
>                                $contents =3D fread($file, $attach_size);
>                                $encoded_attach =3D
> chunk_split(base64_encode($contents));
>                                fclose($file);
>
>                                $mailheaders .=3D "MIME-version: 1.0\n";
>                                $mailheaders .=3D "Content-type:
> multipart/mixed; ";
>                                $mailheaders .=3D
> "boundary=3D\"Message-Boundary\"\n";
>                                $mailheaders .=3D "Content-transfer-encodin=
g:
> 7BIT\n";
>                                $mailheaders .=3D "X-attachments:
> $attach_name";
>
>                                $body_top =3D "--Message-Boundary\n";
>                                $body_top .=3D "Content-type: text/plain;
> charset=3DUS-ASCII\n";
>                                $body_top .=3D "Content-transfer-encoding:
> 7BIT\n";
>                                $body_top .=3D "Content-description: Mail
> message body\n\n";
>
>                                $msg_body =3D $body_top . $msg_body;
>
>                                $msg_body .=3D "\n\n--Message-Boundary\n";
>                                $msg_body .=3D "Content-type: $attach_type;
> name=3D\"$attach_name
> \"\n";
>                                $msg_body .=3D "Content-Transfer-Encoding:
> BASE64\n";
>                                $msg_body .=3D "Content-disposition:
> attachment; filename=3D
> \"$attach_name\"\n\n";
>                                $msg_body .=3D "$encoded_attach\n";
>                                $msg_body .=3D "--Message-Boundary--\n";
>
>
>                                $mensagem =3D mail($to,
> stripslashes($subject), $msg_body,
> $mailheaders);
>
>                        if ($mensagem) {
>                                print "E-mail enviado com sucesso!";
>                        } else {
>                                print "O envio do email falhou!";
>                        }
> ?>
> >
>


--=20
Att,
Rafael Proc=F3pio Vale
51 - 3037-2276
www.infoccus.com.br

------=_Part_4298_3045178.1210872173250
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

s=F3 uma id=E9ia:<br><br><a href=3D"http://phpmailer.codeworxtech.com/">http=
://phpmailer.codeworxtech.com/</a><br><br><div class=3D"gmail_quote">On Thu,=
 May 15, 2008 at 2:16 PM, Vitor de Oliveira &lt;<a href=3D"mailto:vitorbh@gm=
ail.com">vito...@gmail.com</a>&gt; wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 2=
04, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Esse meu codigo de envio de email com anexo esta funcionando mas o<br>
anexo nao aparece com a extens=E3o correta aparece . dat e o correto<br>
seria .pdf<br>
<br>
Segue abaixo o codigo<br>
<br>
&lt;?php &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fro=
m =3D &quot;<a href=3D"mailto:cont...@webforte.com.br">cont...@webforte.com.=
br</a>&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;$to =3D &quot;<a href=3D"mailto:vitor.carva...@hcscomp.com.br">vitor=
.carva...@hcscomp.com.br</a>&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;$body =3D &quot;Corpo do email&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;$subject =3D &quot;Assunto do email&quot;;<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders =3D &quot;From: $from\n&quo=
t;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;X-Mailer: Script=
 para enviar arquivo atachado\n&quot;;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body =3D stripslashes($body);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$attach =3D &quot;xml_xsl.pdf&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$attach_size =3D filesize($attach);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$attach_name =3D &quot;xml_xsl&quot;;<br=
>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$attach_type =3D filetype($attach);<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$file =3D fopen($attach, &quot;r&quot;);=
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$contents =3D fread($file, $attach_size)=
;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$encoded_attach =3D chunk_split(base64_e=
ncode($contents));<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fclose($file);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;MIME-version: 1.=
0\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;Content-type: mu=
ltipart/mixed; &quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;boundary=3D\&quo=
t;Message-Boundary\&quot;\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;Content-transfer=
-encoding: 7BIT\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mailheaders .=3D &quot;X-attachments: $=
attach_name&quot;;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body_top =3D &quot;--Message-Boundary\n=
&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body_top .=3D &quot;Content-type: text/=
plain; charset=3DUS-ASCII\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body_top .=3D &quot;Content-transfer-en=
coding: 7BIT\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body_top .=3D &quot;Content-description=
: Mail message body\n\n&quot;;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body =3D $body_top . $msg_body;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;\n\n--Message-Bound=
ary\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;Content-type: $atta=
ch_type; name=3D\&quot;$attach_name<br>
\&quot;\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;Content-Transfer-En=
coding: BASE64\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;Content-disposition=
: attachment; filename=3D<br>
\&quot;$attach_name\&quot;\n\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;$encoded_attach\n&q=
uot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$msg_body .=3D &quot;--Message-Boundary-=
-\n&quot;;<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$mensagem =3D mail($to, stripslashes($su=
bject), $msg_body,<br>
$mailheaders);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;if ($mensagem) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print &quot;E-mail enviado com sucesso!&=
quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;} else {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print &quot;O envio do email falhou!&quo=
t;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;}<br>
?&gt;<br>
<br>
</blockquote></div><br><br clear=3D"all"><br>-- <br>Att,<br>Rafael Proc=F3pi=
o Vale<br>51 - 3037-2276<br><a href=3D"http://www.infoccus.com.br">www.infoc=
cus.com.br</a>

------=_Part_4298_3045178.1210872173250--


Criar um grupo - Grupos do Google - Página inicial do Google - Termos de Uso - Política de Privacidade
©2009 Google