Ir para conteúdo

POWERED BY:

Arquivado

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

xanburzum

[Resolvido] aspemail,aspmail,aspupload,cdonts,dundas,jmail

Recommended Posts

Neste artigo coloco uma relação de vários componentes de envio de email, mas populares, são eles:

 

- ASPEMAIL

- ASPMAIL

- ASPUPLOAD

- CDONTS

- DUNDAS

- JMAIL

 

Uma boa comparação entre suas sintaxes.

 

ASPEmail:

 

Formulário:

 

<form name="YourFormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Assunto: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comentário: </td>
<td><textarea name=" Comentário "></textarea></td> 
</table>
<input type="submit" name="Submit" value="Submit Form"> 
</form>

confirmation.asp:

 

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mail
strEmail = request.form("Email")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName")
strSubject = request.form("Subject")
strComments = request.form("Comments")
DIM Mail, strMsgHeader
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.seusite.com"
Mail.From = strEmail
Mail.AddAddress "geral@ seusite.com"
Mail.AddCC " geral @ seusite.com"
Mail.Subject = " Formulário  Online "
strMsgHeader = " Este e-mail foi entregue a partir do site Web XXX." & vbCrLf & vbCrLf
Mail.Body = strMsgHeader & "Email: " & strEmail & vbCrLf & _
"First Name: " & strFirstName & vbCrLf & _
"Last Name: " & strLastName & vbCrLf & _
" Assunto: " & strSubject & vbCrLf & vbCrLf & _
" Comentário: " & vbCrLf & strComments
On Error Resume Next
Mail.Send
Set Mail = Nothing
IF Err <> 0 THEN
Response.Write " Houve um erro e sua mensagem não pôde ser enviada através de e-mail. Entre em contato conosco diretamente pelo fone xx-xx-xxxx-xxxx
. " & Err.Description
END IF
%>
<P>
<%
Response.Write strFirstName & ",<br>"
Response.Write " Sua mensagem foi enviada com sucesso." 
%>,</P>

ASPMail

 

<form name="FormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Assunto: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comentário: </td>
<td><textarea name="Comments"></textarea></td> 
</table>
<input type="submit" name="Submit" value="Submit Form"> 
</form>

confirmation.asp:

 

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
strEmail = request.form("Email")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName") 
strSubject = request.form("Subject")
strComments = request.form("Comments")
DIM Mailer, strMsgHeader, qryItem, strMsgInfo
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Admin"
Mailer.FromAddress= "root@seu_site.com"
Mailer.ReplyTo = strEmail
Mailer.RemoteHost = " seu_site.com"
Mailer.AddRecipient " seu_site ", "general@ seu_site.com"
Mailer.Subject = " Form Online "
strMsgHeader = " Esta mensagem foi enviada por email DE XXX" & vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
vbCrLf & "First Name: " & Request.Form("FirstName") & _
vbCrLf & "Last Name: " & Request.Form("LastName") & _
vbCrLf & "Assunto: " & Request.Form("Subject") & _
vbCrLf & " Comentário: " & Request.Form("Comments")
IF Mailer.SendMail THEN
Response.Write strFirstName & ",<br>"
Response.Write " Sua mensagem foi enviada com sucesso."
ELSE
Response.Write "The following error occurred while sending your message: " & Mailer.Response
END IF
%>

ASPUPLOAD

 

<FORM method="Post" action="resultspage.asp" name="Recruiter">
<TABLE width="100%" border="0">
<TR><TD width="30%"><div align="right">Email:</div></TD>
<TD width="70%"><INPUT TYPE="text" name="Email" size="50"></TD></TR>
<TR><TD width="30%"><div align="right">First Name:</div></TD>
<TD width="70%"><INPUT TYPE="text" name="FirstName" size="50"></TD></TR>
<TR><TD width="30%"><div align="right">Last Name:</div></TD>
<TD width="70%"><INPUT TYPE="text" name="LastName" size="50"></TD></TR>
<TR><TD width="30%"><div align="right"> Posição para a aplicação
:</div></TD>
<TD width="70%"><INPUT TYPE="text" name="Position" size="50"></TD></TR>
<TR> <TD width="30%"><div align="right">Resumo:</div></TD>
<TD width="70%"><INPUT TYPE="file" name="Resume" size="35"></TD></TR>
<TR><TD width="30%" valign="top"><div align="right">Com
mentário:</div></TD>
<TD width="70%"><textarea name="Comments" cols="50" rows="5"></textarea></TD></TR>
</TABLE>
<P> 
<INPUT TYPE="submit" name="Submit" value="Submit">
<INPUT TYPE="reset" name="Reset" value="Reset">
</P>
</FORM>

Resultspage.asp:

 

<!--#INCLUDE VIRTUAL="/includes/connection.asp" -->
<%
DIM objRSr, File, Upload, Count, Ext
DIM Mail, strMsgHeader
Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual("/contactus/hr/upload/")
IF NOT Count=0 THEN
FOR EACH File IN Upload.Files
Ext = UCase(Right(File.Path, 3))
IF Ext <> "TXT" AND Ext <> "DOC" THEN
Response.Write Upload.Form("FirstName") & ",<br><br>"
Response.Write "Desculpe " & File.Path & “não está em um formato de .DOC ou de .TXT e não foi entregue  através de nosso sistema. Por favor verifique  seu resumo em um destes formatos e submetê-lo novamente.” 
File.Delete
ELSE
Set objRSr = Server.CreateObject("ADODB.Recordset")
objRSr.Open "tblContact", objConn, , adLockOptimistic, adCmdTable
objRSr.AddNew
objRSr("Data") = "Resumes"
objRSr("Email") = Upload.Form("Email")
objRSr("FirstName") = Upload.Form("FirstName")
objRSr("LastName") = Upload.Form("LastName")
objRSr("Position") = Upload.Form("Position")
objRSr("Comments") = Upload.Form("Comments")
objRSr("DateSubmitted") = Date()
Set File = Upload.Files("fResume")
If Not File Is Nothing Then objRSr("fResume").Value = File.Binary
objRSr.Update
objRSr.Close
Set objRSr = Nothing

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.SEU_DOMINIO_AKI.com"
Mail.From = Upload.Form("Email")
Mail.AddAddress " SEU EMAIL AQUI "
Mail.Subject = "Resumo"
strMsgHeader = " Este email foi entregue de seu Web site." & vbCrLf & vbCrLf
Mail.Body = strMsgHeader & "Email: " & Upload.Form("Email") & vbCrLf & "First Name: " & Upload.Form("FirstName") & vbCrLf & "Last Name: " & Upload.Form("LastName") & vbCrLf & "Position: " & Upload.Form("Position") & vbCrLf & vbCrLf & "Comments: " & Upload.Form("Comments")
IF Count > 0 THEN
Mail.AddAttachment Upload.Files(1).Path
On Error Resume Next
Mail.Send
IF Err <> 0 THEN
Response.Write " Havia um erro que emite sua mensagem. Visitar por favor nosso contato nós página e emitir uma mensagem a nosso Webmaster para relatar este erro: <B>" & Err.Description & "</B>"
ELSE
Response.Write Upload.Form("FirstName") & ","
Response.Write "<p>Obrigado. Sua mensagem foi recebida com sucesso.</p>"
File.Delete
END IF
END IF
END IF
NEXT
%> 
<P>
<%
strName = Request.Form("FirstName")
Response.Write strFirstName
%>,</P>
<P> Obrigado.</P>

CDONTS

 

Formulário:

<form name="FormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Assunto: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comentário: </td>
<td><textarea name="Comments"></textarea></td> 
</table>
<input type="submit" name="Submit" value="Submit Form"> 
</form>

Confirmation.asp:

 

<%
DIM strEmail, strName, strComments, mail, reply, objMail
strEmail = request.form("Email")
strName = request.form("Name")
strComments = request.form("Comments")
mail = "seu_email"
reply = request.form("Email")
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = reply
objMail.Subject = "ASSUNTO"
objMail.To = mail
objMail.Body = "Email: " & strEmail & vbCrLf & _
"Name: " & strName & vbCrLf & _
"Comments: " & vbCrLf & strComments
objMail.Send
Set objMail = nothing
%>
<P>
<%
strName = request.form("Name")
Response.Write strName
%>,</P>
<P> Obrigado.</P>

 

 

 

Dundas

 

Formulário:

 

<form name="YourFormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Assunto: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comentário: </td>
<td><textarea name="Comments"></textarea></td> 
</table>
<input type="submit" name="Submit" value="Submit Form"> 
</form>

confirmation.asp:

 

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
strEmail = Request.Form("Email")
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName") 
strSubject = Request.Form("Subject")
strComments = Request.Form("Comments")
DIM objMailer
intSubscribers = 0
DO WHILE NOT objRSs.EOF
Set objMailer = Server.CreateObject ("Dundas.Mailer")
strSubscriber = objRSs("fSubscriber")
objMailer.SMTPRelayServers.Add = strMailHost
objMailer.FromAddress = strEmail
objMailer.FromName = strFromName
objMailer.TOs.Add strToName & "<" & strSubscriber & ">"
objMailer.Subject = strSubject
objMailer.Body = strComments
objMailer.SendMail
Set objMailer = Nothing
%>

Jmail

 

Formulário:

 

<form name="YourFormName" method="Post" action="confirmation.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>First Name: </td>
<td><input type="text" name="FirstName" size="50"></td></tr>
<tr><td>Last Name: </td>
<td><input type="text" name="LastName" size="50"></td></tr>
<tr><td>Assunto: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comentário: </td>
<td><textarea name="Comments"></textarea></td> 
</table>
<input type="submit" name="Submit" value="Submit Form"> 
</form>

Confirmation.asp:

 

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer
strEmail = Request.Form("Email")
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName") 
strSubject = Request.Form("Subject")
strComments = Request.Form("Comments")
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.seu_site.com"
JMail.AddRecipient "xxx@ seu_site.com"
JMail.Sender = strEmail
JMail.Subject = strSubject
JMail.Body = strComments
JMail.Execute
Set JMail= Nothing
IF NOT JMail.Execute THEN
Response.Write( " MENSAGEM DE ERRO: " & JMail.ErrorMessage & "<BR>" & vbcrlf )
Response.Write( " FONTE DE ERRO: " & JMail.ErrorSource & "<BR>" & vbcrlf )
Response.Write( "LOG: <pre>" & JMail.Log & "</pre>" & vbcrlf )
ELSE
Response.Write "<blockquote>Your :<b>" & strSubject & "</b> Newsletter enviada com sucesso para <b>" & intSubscribers & "</b> subscribers.</blockquote>"
END IF
%>

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.