Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1751
Number of posts: 4473

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Email link Posted by nkc8355 on 12 Jul 2005 at 11:16 PM
Hi,

i am new here and i face a probelm about my code in email link. Iuse CDOSYS to send my email and at the same time i create a link in this coding so that the receiver of the email can click the link and directly send back to user or the sender and bellow are my code for the app.asp file which send the email:

<%
Dim cdoMessage
Dim cdoConfig
Dim strFrom
Dim strTo
Dim strHTML

strFrom = Request.Form("txtMail")
strTo = "nkc8355@hotmail.com"
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1"
.update
End With

Set cdoMessage = CreateObject("CDO.Message")


' build HTML for message body
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<a href =""http://www.nscomp.com/Approve.asp""><input name=""Approve"" type=""submit"" value=""Approve""> "
strHTML = strHTML & "<input name=""Disapprove"" type=""submit"" value=""Disapprove"">"
strHTML = strHTML & "<a href =""http://www.cnscomp.com/Approve.asp?strFrom=nkc8355@yahoo.com|| strTo=nkc8355@hotmail.com""> " & "Approve" & "</a><br>"
strHTML = strHTML & "<a href =""http://www.cnscomp.com/Disapprove.asp ""> "& "Disapprove" & "</a><br>"

strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"


With cdoMessage
Set .Configuration = cdoConfig
.From = strFrom
.To = strTo
.Subject = "Online Leave Application"
.HTMLBody = strHTML
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

and as for the link which is the Approve.asp the coding is bellow:

<%
Dim cdoMessage
Dim cdoConfig
Dim strFrom
Dim strTo
Dim strHTML



sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1"
.update
End With

Set cdoMessage = CreateObject("CDO.Message")


' build HTML for message body
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "From" & Request.Form("txtMail") & "<br>"
strHTML = strHTML & "-------------------------------------------------------------------------" & "<br>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "<b> Your leave has been approve</b></br>"
strHTML = strHTML & "-------------------------------------------------------------------------" & "<br>"
strHTML = strHTML & "Mail Sent on " & Now() & " <br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"


With cdoMessage
Set .Configuration = cdoConfig
.From = strFrom
.To = strTo
.Subject = "Online Leave Application"
.HTMLBody = strHTML
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>


I don't know how to grab the sender and the receiver to the Approve.asp in dynamic which the email address from the sender will not be fix to one email address only. Your help will be appreciated.

Thank you,

You all can call me Tom.
Report
Re: Email link Posted by Flakes on 13 Jul 2005 at 3:12 AM
strHTML = strHTML & "<a href =""http://www.cnscomp.com/Approve.asp?strFrom=nkc8355@yahoo.com&strTo=nkc8355@hotmail.com""> " & "Approve" & "</a><br>" 



And in Approve.asp page you get the values as :

	strTo=Request("strTo")
	strFrom=Request("strFrom")


Report
Re: Email link Posted by cloudy83 on 23 May 2007 at 7:43 PM
: Hi,
:
: i am new here and i face a probelm about my code in email link. Iuse
: CDOSYS to send my email and at the same time i create a link in this
: coding so that the receiver of the email can click the link and
: directly send back to user or the sender and bellow are my code for
: the app.asp file which send the email:
:
: <%
: Dim cdoMessage
: Dim cdoConfig
: Dim strFrom
: Dim strTo
: Dim strHTML
:
: strFrom = Request.Form("txtMail")
: strTo = "nkc8355@hotmail.com"
: sch = "http://schemas.microsoft.com/cdo/configuration/"
: Set cdoConfig = CreateObject("CDO.Configuration")
:
: With cdoConfig.Fields
: .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
: .Item(sch & "smtpserver") = "127.0.0.1"
: .update
: End With
:
: Set cdoMessage = CreateObject("CDO.Message")
:
:
: ' build HTML for message body
: strHTML = "<HTML>"
: strHTML = strHTML & "<HEAD>"
: strHTML = strHTML & "<BODY>"
: strHTML = strHTML & "<a href
: =""http://www.nscomp.com/Approve.asp""><input name=""Approve""
: type=""submit"" value=""Approve""> "
: strHTML = strHTML & "<input name=""Disapprove"" type=""submit""
: value=""Disapprove"">"
: strHTML = strHTML & "<a href
: =""http://www.cnscomp.com/Approve.asp?strFrom=nkc8355@yahoo.com||
: strTo=nkc8355@hotmail.com""> " & "Approve" & "</a><br>"
: strHTML = strHTML & "<a href
: =""http://www.cnscomp.com/Disapprove.asp ""> "& "Disapprove" &
: "</a><br>"
:
: strHTML = strHTML & "</BODY>"
: strHTML = strHTML & "</HTML>"
:
:
: With cdoMessage
: Set .Configuration = cdoConfig
: .From = strFrom
: .To = strTo
: .Subject = "Online Leave Application"
: .HTMLBody = strHTML
: .Send
: End With
:
: Set cdoMessage = Nothing
: Set cdoConfig = Nothing
: %>
:
: and as for the link which is the Approve.asp the coding is bellow:
:
: <%
: Dim cdoMessage
: Dim cdoConfig
: Dim strFrom
: Dim strTo
: Dim strHTML
:
:
:
: sch = "http://schemas.microsoft.com/cdo/configuration/"
: Set cdoConfig = CreateObject("CDO.Configuration")
:
: With cdoConfig.Fields
: .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
: .Item(sch & "smtpserver") = "127.0.0.1"
: .update
: End With
:
: Set cdoMessage = CreateObject("CDO.Message")
:
:
: ' build HTML for message body
: strHTML = "<HTML>"
: strHTML = strHTML & "<HEAD>"
: strHTML = strHTML & "<BODY>"
: strHTML = strHTML & "From" & Request.Form("txtMail") & "<br>"
: strHTML = strHTML &
: "--------------------------------------------------------------------
: -----" & "<br>"
: strHTML = strHTML & "<b> This is the test HTML message
: body</b></br>"
: strHTML = strHTML & "<b> Your leave has been approve</b></br>"
: strHTML = strHTML &
: "--------------------------------------------------------------------
: -----" & "<br>"
: strHTML = strHTML & "Mail Sent on " & Now() & " <br>"
: strHTML = strHTML & "</BODY>"
: strHTML = strHTML & "</HTML>"
:
:
: With cdoMessage
: Set .Configuration = cdoConfig
: .From = strFrom
: .To = strTo
: .Subject = "Online Leave Application"
: .HTMLBody = strHTML
: .Send
: End With
:
: Set cdoMessage = Nothing
: Set cdoConfig = Nothing
: %>
:
:
: I don't know how to grab the sender and the receiver to the
: Approve.asp in dynamic which the email address from the sender will
: not be fix to one email address only. Your help will be appreciated.
:
: Thank you,
:
: You all can call me Tom.
:
hi tom, r u doing the online leave application?
can u reply me when u get this msg?
thanx.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.