Jump to content


Photo

Problemas Ao Enviar Email


  • Faça o login para participar
2 replies to this topic

#1 Worms_Psy

Worms_Psy

    Novato no fórum

  • Usuários
  • 3 posts
  • Sexo:Masculino

Posted 01/12/2005, 17:55

Dae galera.

estou com um problema na hora de enviar email, trata-se de um carrinho de compras quando cara clica para ver o que tem no carrinho temum botão finalizar pedido
que carrega uma outra pagina que lista tudo o que tem no carrinho e adiciona um formulario para o cara colocar nome, endereço, etc...
mas na hora de enviar não consegui de jeito nenhum adicionar os intes que tinha no carrinho.
alguem sabe como posso fazer???


valeuuu té+++

#2 Agente Linhares

Agente Linhares

    fuis...abraços!

  • Ex-Admins
  • 3138 posts
  • Sexo:Não informado
  • Localidade:Biritiba Mirim-SP

Posted 02/12/2005, 10:07

- primeiro, comece postando o code q vc ta usando. (so a parte do problema)


solução: vc pode pegar os valores via request.form, request.querystring, session, etc...
> Busca On-line - A Busca que faltava na Internet! - Cadastre-se!
---------------------------------------------------------------------------
> BRdesign.NET - Soluções em Websites e Sistemas E-Commerce.
---------------------------------------------------------------------------
> BR-ecommerce - Sua loja virtual na internet! - Apenas R$99,90 mensais (hospedagem inclusa)!

#3 Worms_Psy

Worms_Psy

    Novato no fórum

  • Usuários
  • 3 posts
  • Sexo:Masculino

Posted 02/12/2005, 13:15

Segue o codigo ae!!!
a parte que esta em negrito é o que lista os produtos.
e isso que eu preciso colocar no email depois
que esta em italico.
se alguem souber como arrumar ali valeuuu mesmooo





<!--#include virtual="/global/includes/screenMessages.asp"-->
<!--#include virtual="/global/includes/cartFunctions.asp"-->
<!--#include virtual="/global/includes/currencyFormat.asp"-->
<!--#include virtual="/global/includes/databaseFunctions.asp"-->
<!--#include virtual="/global/includes/settings.asp"-->
<!--#include virtual="/global/includes/getSettingKey.asp"-->
<!--#include virtual="/global/includes/sessionFunctions.asp"-->
<!--#include virtual="/global/includes/miscFunctions.asp"-->

<%

on error resume next

dim mySQL, connTemp, rsTemp, rsTemp2, rsTemp7, pDefaultLanguage, pStoreFrontDemoMode, pCurrencySign, pDecimalSign, pMoneyDontRound, pCompany, pCompanyLogo, pHeaderKeywords, pAuctions, pListBestSellers, pNewsLetter, pPriceList, pStoreNews, pOneStepCheckout, pRealTimeShipping, pAllowNewCustomer, pByPassShipping, total, totalDeliveringTime, pIdDbSession, pIdDbSessionCart, pIdCustomer, pIdCustomerType, pLanguage, pCustomerName, pHeaderCartItems, pHeaderCartSubtotal, pAffiliatesStoreFront, pIdCartRow, pIdProduct, pQuantity, pUnitPrice, pDescription, pSku, pDeliveringTime, pPersonalizationDesc, pRental, pItHasFreeProduct, pDetails, pOptionGroupsTotal, pRowPrice

' get settings

pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode")
pCurrencySign = getSettingKey("pCurrencySign")
pDecimalSign = getSettingKey("pDecimalSign")
pCompany = getSettingKey("pCompany")
pCompanyLogo = getSettingKey("pCompanyLogo")
pMoneyDontRound = getSettingKey("pMoneyDontRound")
pByPassShipping = getSettingKey("pByPassShipping")
pTaxIncluded = getSettingKey("pTaxIncluded")
pRealTimeShipping = getSettingKey("pRealTimeShipping")
pAllowNewCustomer = getSettingKey("pAllowNewCustomer")

pAffiliatesStoreFront = getSettingKey("pAffiliatesStoreFront")
pSuppliersList = getSettingKey("pSuppliersList")
pAuctions = getSettingKey("pAuctions")
pNewsLetter = getSettingKey("pNewsLetter")


total = Cdbl(0)
totalDeliveringTime = Cdbl(0)

pIdDbSession = checkSessionData()
pIdDbSessionCart = checkDbSessionCartOpen()

pIdCustomerType = getSessionVariable("idCustomerType",1)

' check if the cart is empty
if countCartRows(pIdDbSessionCart)=0 then
response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(40,"emtpy"))
end if

%>

<%
sub manda
Dim msg, texto
Set msg = Server.CreateObject("CDONTS.NewMail")
texto = "<html><body>"
texto = texto & "<table>"
texto = texto & "<tr><td><b> Nome: </b></td>"
texto = texto & "<td>" & Request ("nome") & "</td></tr>"
texto = texto & "<tr><td><b> CPF: </b></td>"
texto = texto & "<td>" & Request ("cpf") & "</td></tr>"
texto = texto & "<tr><td><b> Empresa: </b></td>"
texto = texto & "<td>" & Request ("empresa") & "</td></tr>"
texto = texto & "<tr><td><b> CNPJ: </b></td>"
texto = texto & "<td>" & Request ("cnpj") & "</td></tr>"
texto = texto & "<tr><td><b> E-mail: </b></td>"
texto = texto & "<td>" & Request ("email") & "</td></tr>"
texto = texto & "<tr><td><b> Telefone: </b></td>"
texto = texto & "<td>" & Request ("tel1") & "-" & Request ("tel2") & "</td></tr>"
texto = texto & "<tr><td><b> Endereço: </b></td>"
texto = texto & "<td>" & Request ("endereco") & "</td></tr>"
texto = texto & "<tr><td><b> Bairro: </b></td>"
texto = texto & "<td>" & Request ("bairro") & "</td></tr>"
texto = texto & "<tr><td><b> Cidade: </b></td>"
texto = texto & "<td>" & Request ("cidade") & "</td></tr>"
texto = texto & "<tr><td><b> Estado:: </b></td>"
texto = texto & "<td>" & Request ("estado") & "</td></tr>"
texto = texto & "<tr><td><b> Cep: </b></td>"
texto = texto & "<td>" & Request ("cep") & "</td></tr>"
texto = texto & "</table>"
texto = texto & "</body></html>"
msg.From = "teste@teste.com.br"
msg.To="felipe@radiacaoweb.com.br"
msg.Subject = "Email em HTML"
msg.BodyFormat = 0
msg.MailFormat = 0
msg.Body = texto
msg.Send
Set msg = Nothing
Response.Redirect("resposta_email.asp")

end sub

if Request("nome") <> "" then
manda
end if
%>



<!--#include file="header.asp"-->
<script LANGUAGE="JavaScript">
function validateNumber(field)
{
var val = field.value;
if(!/^\d*$/.test(val)||val==0)
{
alert("<%=getMsg(41,"values >0")%>");
field.focus();
field.select();
}
}
</script>
<br>
<div><form action="finaliza_pedido.asp" method="get">
<table width="548" border="0" align="center" id="01">
<tr>
<td width="50" bgcolor="#ff6600"><%=getMsg(43,"Qty")%></td>
<td width="230" bgcolor="#ff6600"><%=getMsg(44,"Item")%></td>
<td width="170" bgcolor="#ff6600"><%=getMsg(45,"Opt")%></td>
<td bgcolor="#ff6600"><%=getMsg(46,"Price")%></td>
</tr>
<%
mySQL="SELECT idCartRow, cartRows.idProduct, quantity, unitPrice, description, sku, deliveringTime, personalizationDesc, rental FROM cartRows, products WHERE cartRows.idProduct=products.idProduct AND cartRows.idDbSessionCart="&pIdDbSessionCart

call getFromDatabase(mySQL, rstemp, "showCart")

do while not rstemp.eof
pIdCartRow = rstemp("idCartRow")
pIdProduct = rstemp("idProduct")
pQuantity = rstemp("quantity")
pUnitPrice = Cdbl(rstemp("unitPrice"))
pDescription = rstemp("description")
pSku = rstemp("sku")
pDeliveringTime = rstemp("deliveringTime")
pPersonalizationDesc = rstemp("personalizationDesc")
pRental = rstemp("rental")

%>
<tr>
<td><%=pQuantity%></td>
<td><%=pSku%> - <%=pDescription%>
<%if pPersonalizationDesc<>"" then response.write "&nbsp;(" &pPersonalizationDesc& ")"%> </td>
<td><%=getCartRowOptionals(pIdCartRow)%></td>
<td><%=pCurrencySign & money(getCartRowPrice(pIdCartRow))%> </td>
</tr>
<p>
<%
if Cint(pDeliveringTime)>totalDeliveringTime then
totalDeliveringTime = Cint(pDeliveringTime)
end if

rstemp.moveNext
loop
%>
</table>
<br>
<p><br>
<b> <%=getMsg(50,"Total")%> <%=pCurrencySign & money(calculateCartTotal(pIdDbSessionCart)) %></b>
<%if pTaxIncluded<>"-1" then%>
<i> <%=getMsg(51,"Tx inc")%></i> <br>
<%else%>
<i> <%=getMsg(52,"Tax n/incl")%></i> <br>
<%end if%>

<%=getMsg(53,"Availability")%>&nbsp;
<%
if totalDeliveringTime>0 and totalDeliveringTime<999 then
response.write totalDeliveringTime & " " & getMsg(54," days")
end if
if totalDeliveringTime=0 then
response.write getMsg(56,"same day")
end if
' use 999 for undetermined
if totalDeliveringTime>998 then
response.write getMsg(55,"Und")
end if
%>
<br>
<br>

</p>
<p><b>Para finalizar a sua compra preencha todos os campos abaixo.</b><br>
* Os campos empresa e cnpj n&atilde;o s&atilde;o de preenchimento obrigatorio.. </p>
<table width="548" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="80"><div align="right">Nome:</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="nome" type="text" id="nome" style="width:450" ></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">CPF::</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="cpf" type="text" id="cpf" style="width:200"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">Empresa:</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="empresa" type="text" id="empresa" style="width:450"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right"> CNPJ: </div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="cnpj" type="text" id="cnpj" style="width:200"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">E-mail:</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="email" type="text" id="email" style="width:450"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">Telefone:</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="tel1" type="text" id="tel1" style="width:30" maxlength="2">
- <input name="tel2" type="text" id="tel2" style="width:155"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right"></div></td>
<td width="5">&nbsp;</td>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td width="80"><div align="right">Endere&ccedil;o:</div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="endereco" type="text" id="endereco" style="width:450"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">Bairro:</div></td>
<td width="5">&nbsp;</td>
<td><input name="bairro" type="text" id="bairro" style="width:200"></td>
<td>&nbsp;</td>
<td><div align="right">Cidade:</div></td>
<td>&nbsp;</td>
<td><input name="cidade" type="text" id="cidade" style="width:200"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>
<tr>
<td width="80"><div align="right">Estado:</div></td>
<td width="5">&nbsp;</td>
<td width="200"><%

' get stateCodes
mySQL="SELECT stateCode, stateName FROM stateCodes ORDER BY stateName"

call getFromDatabase(mySql, rstemp2,"customerRegistrationForm")

%>
<SELECT name=estado size=1 id="estado">
<OPTION value=""><%=getMsg(245,"select")%>
<%do while not rstemp2.eof
pStateCode2=rstemp2("stateCode")%>
<option value="<%=pStateCode2%>" <%if request.form("stateCode")=pStateCode2 then response.write " selected" %>><%=rstemp2("stateName")%>
<%rstemp2.movenext
loop%>
</OPTION>
</SELECT></td>
<td width="5">&nbsp;</td>
<td width="65"><div align="right">CEP:</div></td>
<td width="5">&nbsp;</td>
<td width="245"><input name="cep" type="text" id="cep" style="width:200"></td>
</tr>
<tr>
<td height="5" colspan="7"></td>
</tr>


<tr>
<td width="80"><div align="right"></div></td>
<td width="5">&nbsp;</td>
<td colspan="5"><input name="venha" type="hidden" id="venha" value="document.forms[0].body.InnerHTML"></td>
</tr>
</table>
<p><a href="finaliza_pedido.asp">
<input name="Submit" type="submit" value="Finalizar Pedido">
</a></p>
</form>
<!--#include file="footer.asp"-->
<%call closeDb()%>




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq