Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Email link

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:

<% <br /> Dim cdoMessage
Dim cdoConfig
Dim strFrom
Dim strTo
Dim strHTML

strFrom = Request.Form("txtMail")
strTo = "[email protected]"
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 = ""
strHTML = strHTML & ""
strHTML = strHTML & ""
strHTML = strHTML & " "
strHTML = strHTML & ""
strHTML = strHTML & "
" & "Approve" & "
"
strHTML = strHTML & " "& "Disapprove" & "
"

strHTML = strHTML & ""
strHTML = strHTML & ""


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:

<% <br /> 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 = ""
strHTML = strHTML & ""
strHTML = strHTML & ""
strHTML = strHTML & "From" & Request.Form("txtMail") & "
"
strHTML = strHTML & "-------------------------------------------------------------------------" & "
"
strHTML = strHTML & " This is the test HTML message body"
strHTML = strHTML & " Your leave has been approve"
strHTML = strHTML & "-------------------------------------------------------------------------" & "
"
strHTML = strHTML & "Mail Sent on " & Now() & "
"
strHTML = strHTML & ""
strHTML = strHTML & ""


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.

Comments

Sign In or Register to comment.