Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

zanelati2002

enviu de email jmail

Recommended Posts

bom tenho um sistema de cadastro de membros no meu site, o que quero que sua senha e o login seja enviado para seu email junto com uma mensagem de agradecimento o codigo que me ajudaram a fazer não esta com pau e não esta dando erro mais não esta chegando email nenhum para o membro tente para ver se quizer testar e quem puder me ajudar o codigo é este já o com o jmail mais não esta enviando o email.

<%Option ExplicitDim sql, rsUser, username, password, passwordconfirm, firstname, surname, email, dob, ---, notfilled(7), badflag, count, passwordLength, calltype, icon, starsign, dobmonth, dobday, sendemail'Assign form values to variablesusername = Request.Form("username")'Make sure they've not put any quotation marks in their usernameIf InStr(username,chr(34)) <> 0 or InStr(username,chr(39)) <> 0 then	errorfunction("invalidchars")end iffirstname = Request.Form("firstname")surname = Request.Form("surname")email = Request.Form("email")--- = Request.Form("---")password = Request.Form("password")passwordconfirm = Request.Form("passwordconfirm")dob = Request.Form("birth_day") & "/" & Request.Form("birth_month") & "/" & Request.Form("birth_year")icon = Request.Form("icon")'Only way to set a variable from a checkbox:if Request.Form("sendemail") = "on" then sendemail = True else sendemail = False end if'Check everything's been filled in, badflag determines whether error function is calledbadflag = 0'nofilled() is an array that will store the fields which are not filled inif firstname = "" then	notfilled(0) = "First Name"	badflag = 1end ifif surname = "" then	notfilled(1) = "Surname"	badflag = 1end ifif email = "" then	notfilled(2) = "Email"	badflag = 1end ifif username = "" then	notfilled(3) = "Username"	badflag = 1end ifif password = "" then	notfilled(4) = "Password"	badflag = 1end ifif --- = "" then	notfilled(5) = "---"	badflag = 1end ifif IsDate(dob) = "False" then	notfilled(6) = "Date of Birth"	badflag = 1end ifif icon = "" then	notfilled(7) = "Your choice of icon"	badflag = 1end ifif badflag = 1 then	signuperror()end if'Check password length is between 5 and 15 characters longpasswordLength = Len(password)if passwordLength < 5 or passwordLength > 15 then	errorfunction("length")end if'Check password and confirmed password are the sameif password <> passwordconfirm then	errorfunction("confirm")end if'Open connection and insert user details into the database%><!--#include file="conn.asp"--><%'For a bit of profiling fun, get their star signgetstarsign()'Then add it to the database. It's in a seperate function because we need to error trap to see if there's been a duplicate entry. It's not good form to have On Error Resume Next throughout your whole pageUserUpdate()Function UserUpdate()On Error Resume NextSet rsUser = Server.CreateObject("ADODB.Recordset")rsUser.open "users", conn, 3, 3rsUser.AddNewrsUser("username") = usernamersUser("password") = passwordrsUser("firstname") = firstnamersUser("surname") = surnamersUser("email") = emailrsUser("dob") = dobrsUser("starsign") = starsignrsUser("---") = sexrsUser("icon") = iconrsUser("sendemail") = sendemailrsUser("DataCadastro") = DatersUser.Updateif Err.Number = -2147217887 then	Err.clear	errorfunction("badusername")else	'Set username cookie to sign them in now	Response.Cookies("username") = username%><html><head></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2>  <center><p><b><%=firstname%> <%=surname%>, obrigado por se cadastrar.</b></p>  <p><b>Você agora possui um nome de usuário <b><%=username%></b> e está   logado!</b></p>  <p><a href="index.asp">Clique aqui para voltar á página inicial</a><p>  </font>  </td></tr></table></body></html><%Set Mail = Server.CreateObject("JMail.SMTPMail")sCorpo = "Olá "& firstname &" " & surname & "Site do Zanelati, dá as Boas Vindas ao mais novo membro." &  VbCrLf & "Não perca seu login: " & username & " e nem sua senha: " & password & VbCrLf & "Acesse já: http://www.libihost.net/sitedozanelati" &  VbCrLf & VbCrLf & "Este cadastro valera somente para mais 10 dias se o site não for acessado ele se excluirá, e precisará de um novo cadastrado para ter acesso ao Site." &  VbCrLf & VbCrLf & "Grato" &  VbCrLf & VbCrLf & "Equipe do Site do Zanelati"assunto = "Seu dados!"Mail.ServerAddress = "mail.libihost.net"Mail.Logging = TrueMail.Sender = "sitedozanelati@ig.com.br"Mail.SenderName = "Site do Zanelati"Mail.AddRecipient = emailMail.Subject = assuntoMail.Body = sCorpoMail.ExecuteSet Mail = Nothing%><%rsUser.closeset rsUser = nothingconn.closeset conn = nothing%><%end ifEnd Function%><%Function getstarsign()dobmonth = Request.Form("birth_month")dobday = Request.Form("birth_day")Select Case dobmonth	Case 1  if dobday < 21 then 	 starsign = "Capricorn"  else 	 starsign = "Aquarius"  end if	Case 2  if dobday < 20 then 	 starsign = "Aquarius"  else 	 starsign = "Pisces"  end if	Case 3  if dobday < 21 then 	 starsign = "Pisces"  else 	 starsign = "Aries"  end if	Case 4  if dobday < 21 then 	 starsign = "Aries"  else 	 starsign = "Taurus"  end if	Case 5  if dobday < 22 then 	 starsign = "Taurus"  else 	 starsign = "Gemini"  end if	Case 6  if dobday < 22 then 	 starsign = "Gemini"  else 	 starsign = "Cancer"  end if	Case 7  if dobday < 24 then 	 starsign = "Cancer"  else 	 starsign = "Leo"  end if	Case 8  if dobday < 24 then 	 starsign = "Leo"  else 	 starsign = "Virgo"  end if	Case 9  if dobday < 24 then 	 starsign = "Virgo"  else 	 starsign = "Libra"  end if	Case 10  if dobday < 24 then 	 starsign = "Libra"  else 	 starsign = "Scorpio"  end if	Case 11  if dobday < 23 then 	 starsign = "Scorpio"  else 	 starsign = "Sagittarius"  end if	Case 12  if dobday < 22 then 	 starsign = "Sagittarius"  else 	 starsign = "Capricorn"  end ifEnd SelectEnd Function%><%Function signuperror()%><html><head></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial" size=2><p><b>Você não preencheu os dados corretamente.</b></p><%for count = 0 to 7%>	<%if notfilled(count) <> "" then%>	<b><%=notfilled(count)%></b><br>	<%end if%><%next%><p><a href="javascript:self.history.go(-1)">Tente denovo.</a></p></font></table></body></html><%Response.endEnd Function%><%Function errorfunction(calltype)%><html><head></head><body bgcolor="#FFFFFF" link="#DD0000" vlink="#DD0000" alink="#000000"><font face="arial,helvetica" size=2><%if calltype = "confirm" then%><p><b>As senhas digitadas não conferem.</b></p><p><a href="javascript:self.history.go(-1)">Tente denovo.</a></p></font></body></html><%Response.end%><%elseif calltype = "length" then%><p><b>A senha precisa ter entre 5 e 15 caracteres.</b></p><p><a href="javascript:self.history.go(-1)">Tente denovo.</a></p></font></body></html><%Response.end%><%elseif calltype = "badusername" then%><p><b>Desculpe, o username "<%=username%>" já existe.</b></p><p><a href="javascript:self.history.go(-1)">Tente denovo.</a></p></font></body></html><%rsUser.closeset rsUser = nothingconn.closeset conn = nothingResponse.end%><%elseif calltype = "invalidchars" then%><p><b>Desculpe, mas seu username contém caracteres inválidos.</b></p><p><a href="javascript:self.history.go(-1)">Tente denovo.</a></p></font></body></html><%Response.end%><%end ifEnd Function%>

OBS> o codigo não esta com erro somente não envia o email para o cara que acabou de se cadastrar.

entre no site para testar .

 

http://www.libihost.net/sitedozanelati/index.asp

Compartilhar este post


Link para o post
Compartilhar em outros sites

q zuado velho... eh f*** hein... naum da erro nenhum???? ja checou se tem algum on error resume next na pagina??? eu achei um la ne.. tira ele q o erro aparece... mas e naum aparecer.... o jeito eh voltar ao tempo... naum tem jeito.. se ele naum da erro e naum envia a msg, se essa info estiver correta ele naum vai enviar nenhum e-mail... naum so desse script, mas de nenhum... faz o teste ne, quem sabe...

 

<html><head><title>Confirmation </title><body><%Set JMail = Server.CreateObject("JMail.SMTPMail")' This is my local SMTP serverJMail.ServerAddress = "mail.yourdomain.com:25"' This is me....JMail.Sender = "myemail@mydomain.net"JMail.Subject = "Here you go..."' Get the recipients mailbox from a form (note the lack of a equal sign).JMail.AddRecipient "mum@any.com"JMail.AddRecipient "dad@some.com"' The body property is both read and write.' If you want to append text to the body you can' use JMail.Body = JMail.Body & "Hello world!"' or you can use JMail.AppendText "Hello World!"' which in many cases is easier to use.JMail.Body = "Here you go. Your request has been approved" &_"and the program is attached to this message"' 1 - highest priority (Urgent)' 3 - normal' 5 - lowestJMail.Priority = 1JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")' Send it...JMail.Execute%><center>An e-mail has been sent to your mailbox (<%=request.form("email")%>).</center></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.