Fórum multiplas imagens corpo email #412967
19/02/2012
0
boa tarde amigos do forum, venho aki pedir uma ajuda de voces, e o seguinte, a minha aplicacao tem uma funcao de enviar email, os dados do email sao baseados nos dados do formulario, ate ai tudo bem ja fiz e ta funcionando legal, so que o problema e que existem tres opcoes de orçamentos, o que eu quer e o seguinte, enviar no email os dados das opcoes que eu escolher, mas o cabeçalho tem que ser igual so que o corpo do email vai ser baseado nas opcoes que eu escolher, se eu escoher somente uma opcao ele envia certinho os dados e a imagem, mas se eu adiciono a segunda opcao, ele nao carrega a imagem dela e tambem os caracteres do corpo do email nao aparecem corretamente, vou postar o codigo que estou usando para vcs terem uma ideia:
//OPCAO 1
if rbEscolher1.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel1.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel1.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
//OPCAO 2
if rbescolher2.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel2.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel2.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal2.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
parte 1 do email que esta correta: http://img571.imageshack.us/img571/5802/parte1i.png
parte 2 do email que esta com erro:http://img27.imageshack.us/img27/3672/parte2um.png
se alguem puder me ajudar, nao manjo muito de html nao !!!
//OPCAO 1
if rbEscolher1.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel1.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel1.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
//OPCAO 2
if rbescolher2.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel2.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel2.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal2.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
parte 1 do email que esta correta: http://img571.imageshack.us/img571/5802/parte1i.png
parte 2 do email que esta com erro:http://img27.imageshack.us/img27/3672/parte2um.png
se alguem puder me ajudar, nao manjo muito de html nao !!!
Willian Bento
Curtir tópico
+ 0
Responder
Posts
20/02/2012
Willian Bento
boa tarde amigos do forum, venho aki pedir uma ajuda de voces, e o seguinte, a minha aplicacao tem uma funcao de enviar email, os dados do email sao baseados nos dados do formulario, ate ai tudo bem ja fiz e ta funcionando legal, so que o problema e que existem tres opcoes de orçamentos, o que eu quer e o seguinte, enviar no email os dados das opcoes que eu escolher, mas o cabeçalho tem que ser igual so que o corpo do email vai ser baseado nas opcoes que eu escolher, se eu escoher somente uma opcao ele envia certinho os dados e a imagem, mas se eu adiciono a segunda opcao, ele nao carrega a imagem dela e tambem os caracteres do corpo do email nao aparecem corretamente, vou postar o codigo que estou usando para vcs terem uma ideia:
//OPCAO 1
if rbEscolher1.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel1.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel1.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
//OPCAO 2
if rbescolher2.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel2.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel2.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal2.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
parte 1 do email que esta correta: http://img571.imageshack.us/img571/5802/parte1i.png
parte 2 do email que esta com erro:http://img27.imageshack.us/img27/3672/parte2um.png
se alguem puder me ajudar, nao manjo muito de html nao !!!
//OPCAO 1
if rbEscolher1.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel1.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel1.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
//OPCAO 2
if rbescolher2.Checked then
begin
with busca_imagem do
begin
Close;
sql.clear;
sql.Add(select hoteis.foto_hotel,hoteis.servicos_hotel,hoteis.formapag,hoteis.conheca_hotel,hoteis.obs from hoteis where nome_hotel = :hotel);
ParamByName(hotel).Value := cbbHotel2.Text;
Open;
end;
text := TIdText.Create(email.MessageParts);
text.ContentType := text/html;
text.Body.Add(<HTML><BODY>);
text.Body.Add(<H2><small>Prezado(a): +edtNomeCli.Text+,<small></H2>);
text.Body.Add(<H2><small>Segue Abaixo os Orcamentos para o periodo Solicitado:<small></H2>);
text.Body.Add(<H2>Qualquer Duvida,favor Retornar esse e-mail Informando seu Telefone fixo que Retornamos.</H2>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2>Hotel: +cbbHotel2.Text+</H2>);
//text.Body.Add(<BR><BR>);
text.Body.Add(<img>Foto:<img>);
text.Body.Add(<img style=margin:1px 1px 1px 0px;);
text.Body.Add(<IMG SRC=cid:imagem2.jpg width=300 height=200 alt=Foto do Hotel>);
text.Body.Add(<BR><BR>);
text.Body.Add(<H2><font size=-1>Entrada: +edtEntrada2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Saida: +edtSaida2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Noites: +edtNoites2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Single/Duplo: +edtSingle2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Adulto: +edtAdulto2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Adicional Criança: +edtCrianca2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Criança Free: +edtFree2.Text+</font></H2>);
text.Body.Add(<H2><font size=-1>Inclui no Pacote: +busca_imagemSERVICOS_HOTEL.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Forma de Pagamento: +busca_imagemFORMAPAG.AsString+</font></H2>);
text.Body.Add(<H2><font size=-1>Conheça o Hotel: <a href=+busca_imagemCONHECA_HOTEL.AsString+>+busca_imagemCONHECA_HOTEL.AsString+</a></font></H2>);
text.Body.Add(<H2><font size=+1><font color=#rrggbb>TOTAL DO PACOTE: +formatfloat(R$ #,##0.00,StrToFloatDef(edtTotal2.Text,0000.00))+</font></H2>);
text.Body.Add(<H2><font size=-1>Obs: Orçamento Válido por 24h</font></H2>);
//text.Body.Add(</BODY><HTML>);
//anexa as imagens que vai no email
text := TIdText.Create(email.MessageParts);
text.ContentType := text/plain;
anexo := TIdAttachmentFile.Create(email.MessageParts,busca_imagemFOTO_HOTEL.AsString);
anexo.ExtraHeaders.Values[content-ID] := imagem2.jpg;
end;
parte 1 do email que esta correta: http://img571.imageshack.us/img571/5802/parte1i.png
parte 2 do email que esta com erro:http://img27.imageshack.us/img27/3672/parte2um.png
se alguem puder me ajudar, nao manjo muito de html nao !!!
alguem ??
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)