ASP / Value Question

Discussion in 'ASP General' started by Dvan, Aug 20, 2004.

  1. Dvan

    Dvan Guest

    Maybe there is an easy to do this. I am trying to send the results of a
    form to our support mailbox. This works, but I have to provide it with a
    static MailFrom.

    I would like the From to be from the person who submitted the form.

    Any insight? Our exchange server accepts a users Windows Logon, so I can
    provide that and it should work.

    I have a VBscript command that pulls that info plus the Doman into a string,
    I can grab a substring of this to grab the UserID.

    response.write "<input type=hidden name=User value='" & right(LogonUser,7) &
    "'>"

    Can I send this variable to this command somehow?
    <input type=hidden name=mailfrom value=??????>

    TIA
     
    Dvan, Aug 20, 2004
    #1
    1. Advertising

  2. Try:

    <%
    sLogonuser = Request.ServerVariables("AUTH_USER")
    sUsername = Split(sLogonuser & "\")(0)
    sFrom = sUsername & "@yourdomainname.com"
    %>

    You don't have to put this value in a hidden input. If you do that, clever
    people can spoof the from address. Instead, use the code above to generate
    the From address for your mail object.

    Ray at home



    "Dvan" <> wrote in message
    news:OLXa$...
    > Maybe there is an easy to do this. I am trying to send the results of a
    > form to our support mailbox. This works, but I have to provide it with a
    > static MailFrom.
    >
    > I would like the From to be from the person who submitted the form.
    >
    > Any insight? Our exchange server accepts a users Windows Logon, so I can
    > provide that and it should work.
    >
    > I have a VBscript command that pulls that info plus the Doman into a

    string,
    > I can grab a substring of this to grab the UserID.
    >
    > response.write "<input type=hidden name=User value='" & right(LogonUser,7)

    &
    > "'>"
    >
    > Can I send this variable to this command somehow?
    > <input type=hidden name=mailfrom value=??????>
    >
    > TIA
    >
    >
    >
     
    Ray Costanzo [MVP], Aug 21, 2004
    #2
    1. Advertising

  3. Dvan

    Dvan Guest

    Thanks "Ray at home", but the username plus "@yourdomainname.com"
    will not work with my Exchange Server, it has to be either the Network ID
    by itself or the format needs to be in





    "Ray Costanzo [MVP]" <myfirstname at lane34 dot com> wrote in message
    news:%...
    > Try:
    >
    > <%
    > sLogonuser = Request.ServerVariables("AUTH_USER")
    > sUsername = Split(sLogonuser & "\")(0)
    > sFrom = sUsername & "@yourdomainname.com"
    > %>
    >
    > You don't have to put this value in a hidden input. If you do that,

    clever
    > people can spoof the from address. Instead, use the code above to

    generate
    > the From address for your mail object.
    >
    > Ray at home
    >
    >
    >
    > "Dvan" <> wrote in message
    > news:OLXa$...
    > > Maybe there is an easy to do this. I am trying to send the results of a
    > > form to our support mailbox. This works, but I have to provide it with

    a
    > > static MailFrom.
    > >
    > > I would like the From to be from the person who submitted the form.
    > >
    > > Any insight? Our exchange server accepts a users Windows Logon, so I

    can
    > > provide that and it should work.
    > >
    > > I have a VBscript command that pulls that info plus the Doman into a

    > string,
    > > I can grab a substring of this to grab the UserID.
    > >
    > > response.write "<input type=hidden name=User value='" &

    right(LogonUser,7)
    > &
    > > "'>"
    > >
    > > Can I send this variable to this command somehow?
    > > <input type=hidden name=mailfrom value=??????>
    > >
    > > TIA
    > >
    > >
    > >

    >
    >
     
    Dvan, Aug 21, 2004
    #3
  4. You need to take the username, and from that, extract the person's e-mail
    address from your Active Directory. Is that what you're saying?

    Look at this sample code:
    http://groups.google.com/groups?selm=evsPcUHcCHA.1748@tkmsftngp12&rnum=4

    Ray at home

    "Dvan" <> wrote in message
    news:%...
    > Thanks "Ray at home", but the username plus "@yourdomainname.com"
    > will not work with my Exchange Server, it has to be either the Network ID
    > by itself or the format needs to be in
    >
    >
    >
    >
    >
    > "Ray Costanzo [MVP]" <myfirstname at lane34 dot com> wrote in message
    > news:%...
    > > Try:
    > >
    > > <%
    > > sLogonuser = Request.ServerVariables("AUTH_USER")
    > > sUsername = Split(sLogonuser & "\")(0)
    > > sFrom = sUsername & "@yourdomainname.com"
    > > %>
    > >
    > > You don't have to put this value in a hidden input. If you do that,

    > clever
    > > people can spoof the from address. Instead, use the code above to

    > generate
    > > the From address for your mail object.
    > >
    > > Ray at home
    > >
    > >
    > >
    > > "Dvan" <> wrote in message
    > > news:OLXa$...
    > > > Maybe there is an easy to do this. I am trying to send the results of

    a
    > > > form to our support mailbox. This works, but I have to provide it

    with
    > a
    > > > static MailFrom.
    > > >
    > > > I would like the From to be from the person who submitted the form.
    > > >
    > > > Any insight? Our exchange server accepts a users Windows Logon, so I

    > can
    > > > provide that and it should work.
    > > >
    > > > I have a VBscript command that pulls that info plus the Doman into a

    > > string,
    > > > I can grab a substring of this to grab the UserID.
    > > >
    > > > response.write "<input type=hidden name=User value='" &

    > right(LogonUser,7)
    > > &
    > > > "'>"
    > > >
    > > > Can I send this variable to this command somehow?
    > > > <input type=hidden name=mailfrom value=??????>
    > > >
    > > > TIA
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Ray Costanzo [MVP], Aug 21, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. San Diego Guy
    Replies:
    0
    Views:
    582
    San Diego Guy
    Aug 7, 2003
  2. =?Utf-8?B?QW5hY2hvc3RpYw==?=

    RE: Textbox postback putting value,value

    =?Utf-8?B?QW5hY2hvc3RpYw==?=, Jun 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    656
    =?Utf-8?B?S2VpdGggRG9yYW4=?=
    Jun 21, 2004
  3. Mike Brearley

    how to get value from page.asp?value=myvalue

    Mike Brearley, May 14, 2004, in forum: ASP General
    Replies:
    1
    Views:
    145
    Mike Brearley
    May 14, 2004
  4. avcitamer
    Replies:
    6
    Views:
    224
    Bob Barrows [MVP]
    Sep 18, 2008
  5. Dwizz
    Replies:
    10
    Views:
    412
Loading...

Share This Page