Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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:

<%
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 & ""
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:

<%
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 & ""
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

  • FlakesFlakes Posts: 642Member
    [code]
    strHTML = strHTML & " " & "Approve" & "
    "
    [/code]


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

    [code]
    strTo=Request("strTo")
    strFrom=Request("strFrom")

    [/code]
  • cloudy83cloudy83 Posts: 1Member
    : 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 & ""
    : 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:
    :
    : <%
    : 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 & ""
    : 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.
    :
    hi tom, r u doing the online leave application?
    can u reply me when u get this msg?
    thanx.
Sign In or Register to comment.