Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) Py.sendmail (send muito grande)


Matheus-vb6

Pergunta

Como eu resolvo esse problema, gostaria de colocar isso para chegar por e-mail:

"<font size='3' color='blue'>" & "Pesquisa de satisfação 2010" & "</font>" & "<BR><BR>" & frmPrincipal1.lblPergunta1.Caption & " : " & f1p1 & "<BR>" & frmPrincipal1.lblPergunta2.Caption & " : " & f1p2 & "<BR>" & frmPrincipal1.lblPergunta3.Caption & " : " & f1p3 & "<BR>" & frmPrincipal1.lblPergunta4.Caption & " : " & f1p4 & "<BR>" & frmPrincipal1.lblPergunta5.Caption & " : " & f1p5 & "<BR>" & frmPrincipal1.lblPergunta6.Caption & " : " & f1p6 & "<BR>" & frmPrincipal1.lblPergunta7.Caption & " : " & f1p7 & "<BR>" & frmPrincipal1.lblPergunta8.Caption & " : " & f1p8 & "<BR>" & frmPrincipal1.lblPergunta9.Caption & " : " & f1p9 & "<BR>" & frmPrincipal1.lblPergunta10.Caption & " : " & f1p10 & "<BR>" & frmPrincipal2.lblPergunta1.Caption & " : " & f2p1 & "<BR>" & frmPrincipal2.lblPergunta2.Caption & " : " & f2p2 & "<BR>" & frmPrincipal2.lblPergunta3.Caption & " : " & f2p3 & "<BR>" & frmPrincipal2.lblPergunta4.Caption & " : " & f2p4 & "<BR>" & frmPrincipal2.lblPergunta5.Caption & " : " & f2p5 & "<BR>" & frmPrincipal2.lblPergunta7.Caption & " : " & f2p7 & "<BR>" & frmPrincipal2.lblPergunta8.Caption & " : " & f2p8 & "<BR>" & frmPrincipal2.lblPergunta9.Caption & " : " & f2p9 & "<BR>" & frmPrincipal2.lblPergunta10.Caption & " : " & f2p10 & "<BR>" & frmprincipal3.lblPergunta1.Caption & " : " & f3p1 & "<BR>" & frmprincipal3.lblPergunta2.Caption & " : " & f3p2 & "<BR>" & frmprincipal3.lblPergunta3.Caption & " : " & f3p3 & "<BR>" & frmprincipal3.lblPergunta4.Caption & " : " & f3p4 & "<BR>" & frmprincipal3.lblPergunta5.Caption & " : " & f3p5 & "<BR>" & frmprincipal3.lblPergunta7.Caption & " : " & f3p7 & "<BR>" & frmprincipal3.lblPergunta8.Caption & " : " & f3p8 & "<BR>" & frmprincipal3.lblPergunta9.Caption & " : " & f3p9 & "<BR>" & frmprincipal3.lblPergunta10.Caption & " : " & f3p10 & "<BR>" & lblpergunta1.caption & " : " & fabrica & "<BR>" & lblpergunta2.caption & " : " & cursos & "<BR>" & lblsugestao.caption & " : " & sugestao & "<BR>" & lblcomentario.caption & " : " & comentario & "<BR>" & lblconstrutora.caption & " : " & construtora & "<BR>" & lblnome.caption & " : " & nome & "<BR>" & lblcargo.caption & " : " & cargo

Só que o VB corta, e não consigo inserir tudo, tomo eu colocaria tudo isso dentro do k.send?

Editado por Matheus-vb6
Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

matheus, não to entendendo nd...

o q fica preto e vermelho?? o q tem o del e o backspace com a historia??

imagino q o py.sendmail consiga mandar o tamanho q for do email, desde q não exceda o limite do servidor smtp.

fiz agora aqui ate um teste tentando enviar um email com 500.000 caracteres no body (quase 500 kB de email) e o email chegou intero pra mim. e 500 kB é muito texto pra um corpo de email em.

porque você tb não poe o codigo intero q você ta usando pra enviar o email??

Link para o comentário
Compartilhar em outros sites

  • 0

o código fikava parte preto (válido) e a outra parte vermelho (inválido)

eu consegui dividi-los por variaveis

MENSAGEM = "<font size='3' color='blue'>" & "Pesquisa de satisfação 2010" & "</font>" & "<BR><BR>" & frmPrincipal1.lblPergunta1.Caption & " : " & f1p1 & "<BR>" & frmPrincipal1.lblPergunta2.Caption & " : " & f1p2 & "<BR>" & frmPrincipal1.lblPergunta3.Caption & " : " & f1p3 & "<BR>" & frmPrincipal1.lblPergunta4.Caption & " : " & f1p4 & "<BR>" & frmPrincipal1.lblPergunta5.Caption & " : " & f1p5 & "<BR>" & frmPrincipal1.lblPergunta6.Caption & " : " & f1p6 & "<BR>" & frmPrincipal1.lblPergunta7.Caption & " : " & f1p7 & "<BR>" & frmPrincipal1.lblPergunta8.Caption & " : " & f1p8 & "<BR>" & frmPrincipal1.lblPergunta9.Caption & " : " & f1p9 & "<BR>" & frmPrincipal1.lblPergunta10.Caption & " : " & f1p10 & "<BR><BR>" & frmPrincipal2.lblPergunta1.Caption & " : " & f2p1 & "<BR>" & frmPrincipal2.lblPergunta2.Caption & " : " & f2p2 & "<BR>" & frmPrincipal2.lblPergunta3.Caption & " : " & f2p3 & "<BR>" & frmPrincipal2.lblPergunta4.Caption & " : " & f2p4 & "<BR>" & frmPrincipal2.lblPergunta5.Caption & " : " & f2p5 & "<BR>"
MENSAGEM2 = frmPrincipal2.lblPergunta7.Caption & " : " & f2p7 & "<BR>" & frmPrincipal2.lblPergunta8.Caption & " : " & f2p8 & "<BR>" & frmPrincipal2.lblPergunta9.Caption & " : " & f2p9 & "<BR><BR>" & frmPrincipal3.lblPergunta1.Caption & " : " & f3p1 & "<BR>" & frmPrincipal3.lblPergunta2.Caption & " : " & f3p2 & "<BR>" & frmPrincipal3.lblPergunta3.Caption & " : " & f3p3 & "<BR>" & frmPrincipal3.lblPergunta4.Caption & " : " & f3p4 & "<BR>" & frmPrincipal3.lblPergunta5.Caption & " : " & f3p5 & "<BR>" & frmPrincipal3.lblPergunta7.Caption & " : " & f3p7 & "<BR>" & frmPrincipal3.lblPergunta8.Caption & " : " & f3p8 & "<BR>" & frmPrincipal3.lblPergunta9.Caption & " : " & f3p9 & "<BR><BR>" & lblPergunta1.Caption & " : " & fabrica & "<BR>" & lblPergunta2.Caption & " : " & cursos & "<BR>" & lblSugestao.Caption & " : " & sugestao & "<BR>" & lblComentario.Caption & " : " & comentario & "<BR><BR>"
MENSAGEM3 = lblConstrutora.Caption & construtora & "<BR>" & lblNome.Caption & nome & "<BR>" & lblCargo.Caption & cargo
e no k.body
k.Body = mensagem + mensagem2 + mensagem3

a mensagem está chegando sim, mas eu gostaria de saber se há limite por linha de codigo no vb, por em uma linha só (sem variaveis) não consegui mandar diretamente, ficava assim:

printvj.jpg

ou assim

print2h.jpg

por variaveis ele vai, mas por que não consigo fazer sem elas?

Editado por Matheus-vb6
Link para o comentário
Compartilhar em outros sites

  • 0

a agora sim entendi.

uma linha de instrucao no seu codigo não pode passar, se não me engano, de 1024 caracteres.

ai pra dividir uma mesma instrucao em varias linhas você usa o _

exemplo:

MENSAGEM = "<font size='3' color='blue'>" & "Pesquisa de satisfação 2010" & _
"</font>" & "<BR><BR>" & frmPrincipal1.lblPergunta1.Caption & " : " & _
f1p1 & "<BR>" & frmPrincipal1.lblPergunta2.Caption & " : " & f1p2 & _
"<BR>" & frmPrincipal1.lblPergunta3.Caption & " : " & f1p3 & "<BR>" & _
frmPrincipal1.lblPergunta4.Caption & " : " & f1p4 & "<BR>" & _
frmPrincipal1.lblPergunta5.Caption & " : " & f1p5 & "<BR>"[/code] so q tb tem um limite, acho q você pode dividir em ate 25 linhas. mas tb você não precisa dividir em varias variaveis, pode usar uma so tipo assim:
[code]MENSAGEM = "texto" '<-- faz de conta q aqui tem 25 linhas separadas por _

MENSAGEM = MENSAGEM & "outro texto" '<-- aqui tem mais 25 linhas

MENSAGEM = MENSAGEM & "mais texto" '<-- etc

k.Body = MENSAGEM

assim você uso so uma variavel.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,7k
×
×
  • Criar Novo...